Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for multiple access of request body #5

Open
imalsogreg opened this issue Oct 10, 2015 · 1 comment
Open

Add tests for multiple access of request body #5

imalsogreg opened this issue Oct 10, 2015 · 1 comment
Assignees

Comments

@imalsogreg
Copy link
Contributor

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.

@imalsogreg imalsogreg added the bug label Oct 10, 2015
@imalsogreg imalsogreg self-assigned this Oct 10, 2015
@imalsogreg
Copy link
Contributor Author

This should be fixed since I've copied over Delayed routing; but leaving this issue open until I write a test to verify.

@imalsogreg imalsogreg changed the title Multiple parses of Request Body will fail Add tests for multiple access of request body Sep 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant