We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
cohttp-eio does not ensure that the body has been fully consumed before trying to parse the next request.
Example test case with the current output (add to the server.md file in #887 to run it):
server.md
# run @@ fun () -> Eio_mock.Flow.on_read socket [ `Return "POST /no-such-resource HTTP/1.1\r\n\ Content-Length: 4\r\n\ \r\n\ Hi\r\n"; `Return "GET / HTTP/1.1\r\n\r\n"; ];; +socket: read "POST /no-such-resource HTTP/1.1\r\n" + "Content-Length: 4\r\n" + "\r\n" + "Hi\r\n" +socket: wrote "HTTP/1.1 404 Not Found\r\n" + "\r\n" + "HTTP/1.1 400 Bad Request\r\n" + "\r\n" Exception: Failure "Expected ' ' but got '\\r'".
I would expect something like this:
# run @@ fun () -> Eio_mock.Flow.on_read socket [ `Return "POST /no-such-resource HTTP/1.1\r\n\ Content-Length: 4\r\n\ \r\n\ Hi\r\n"; `Return "GET / HTTP/1.1\r\n\r\n"; ];; +socket: read "POST /no-such-resource HTTP/1.1\r\n" + "Content-Length: 4\r\n" + "\r\n" + "Hi\r\n" +socket: wrote "HTTP/1.1 404 Not Found\r\n" + "content-length: 0\r\n" + "\r\n" +socket: read "GET / HTTP/1.1\r\n" + "\r\n" +socket: wrote "HTTP/1.1 200 OK\r\n" + "content-length: 4\r\n" + "content-type: text/plain; charset=UTF-8\r\n" + "\r\n" + "root" - : unit = ()
(this also demonstrates the missing content-length header, as reported in #883)
/cc @bikallem
The text was updated successfully, but these errors were encountered:
Thanks for this bug report. Agreed. Error responses should have content-length specified.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
cohttp-eio does not ensure that the body has been fully consumed before trying to parse the next request.
Example test case with the current output (add to the
server.md
file in #887 to run it):I would expect something like this:
(this also demonstrates the missing content-length header, as reported in #883)
/cc @bikallem
The text was updated successfully, but these errors were encountered: