Fix middleware bugs (sending headers after they have already been sent)
Fix middleware bugs (sending headers after they have already been sent)

felixrieseberg/TechReadyTweets,felixrieseberg/TechReadyTweets