Skip to content

Add tests for multiple access of request body #5

Description

@imalsogreg

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: haskell-servant/servant#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.

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions