Update reqBodyRef comment.
This commit is contained in:
parent
726848b8a3
commit
b43301967d
1 changed files with 5 additions and 2 deletions
|
@ -33,8 +33,11 @@ data ReqBodyState = Uncalled
|
|||
toApplication :: RoutingApplication -> Application
|
||||
toApplication ra request respond = do
|
||||
reqBodyRef <- newIORef Uncalled
|
||||
-- We need to check the requestBody possibly more than once, so instead
|
||||
-- of consuming it entirely once, we cycle through it.
|
||||
-- We may need to consume the requestBody more than once. In order to
|
||||
-- maintain the illusion that 'requestBody' works as expected,
|
||||
-- 'ReqBodyState' is introduced, and the complete body is memoized and
|
||||
-- returned as many times as requested with empty "Done" marker chunks in
|
||||
-- between.
|
||||
-- See https://github.com/haskell-servant/servant/issues/3
|
||||
let memoReqBody = do
|
||||
ior <- readIORef reqBodyRef
|
||||
|
|
Loading…
Reference in a new issue