@@ -27,12 +27,15 @@ import Servant.API
2727import Servant.Common.Text
2828
2929data ReqBodyState = Uncalled
30− | Called B.ByteString
31− | Done B.ByteString
30+ | Called !B.ByteString
31+ | Done !B.ByteString
3232
3333toApplication :: RoutingApplication -> Application
3434toApplication ra request respond = do
3535 reqBodyRef <- newIORef Uncalled
36+ -- We need to check the requestBody possibly more than once, so instead
37+ -- of consuming it entirely once, we cycle through it.
38+ -- See https://github.com/haskell-servant/servant/issues/3
3639 let memoReqBody = do
3740 ior <- readIORef reqBodyRef
3841 case ior of