@@ -312,12 +312,13 @@ serveConnection settings th port app conn remoteHost' =
312312 liftIO $ T.pause th
313313 res <- app env
314314
315+ liftIO $ T.resume th
316+ keepAlive <- sendResponse th env conn res
317+
315318 -- flush the rest of the request body
316319 requestBody env $$ CL.sinkNull
317320 ResumableSource fromClient' _ <- liftIO getSource
318321
319− liftIO $ T.resume th
320− keepAlive <- sendResponse th env conn res
321322 when keepAlive $ serveConnection'' fromClient'
322323 Just intercept -> do
323324 liftIO $ T.pause th