Snap request bodies are InputStream ByteString (or similar) io-streams, and can't be consumed more than once (same issue as for the warp servant server: https://github.com/haskell-servant/servant/issues/3). This can be fixed by, when a request body is consumed, building a new Request from the old and seeding it with a new io-stream build from the consumed ByteString.
This shouldn't be hard, but we will have to force a size limit on the request body (which we want to be configurable when the server starts, through the normal snap config machinery). We will need to use the request-building functions from an Internal module of snap-core, because this kind of request-monkeying is usually something snap users are supposed to avoid doing.
Snap request bodies are
InputStream ByteString
(or similar) io-streams, and can't be consumed more than once (same issue as for the warp servant server: https://github.com/haskell-servant/servant/issues/3). This can be fixed by, when a request body is consumed, building a new Request from the old and seeding it with a new io-stream build from the consumed ByteString.This shouldn't be hard, but we will have to force a size limit on the request body (which we want to be configurable when the server starts, through the normal snap config machinery). We will need to use the request-building functions from an Internal module of snap-core, because this kind of request-monkeying is usually something snap users are supposed to avoid doing.