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

Correctly detect obsolete header line folding #39

Closed
GeorgeLyon opened this issue Feb 22, 2018 · 0 comments
Closed

Correctly detect obsolete header line folding #39

GeorgeLyon opened this issue Feb 22, 2018 · 0 comments

Comments

@GeorgeLyon
Copy link

From https://tools.ietf.org/html/rfc7230#section-3.2.4

A server that receives an obs-fold in a request message that is not
within a message/http container MUST either reject the message by
sending a 400 (Bad Request), preferably with a representation
explaining that obsolete line folding is unacceptable, or replace
each received obs-fold with one or more SP octets prior to
interpreting the field value or forwarding the message downstream.

Picohttpparser currently treats header fields with "\r\n\t" in the value as two header fields. For instance GET /hoge HTTP/1.1\r\nHost: ex\r\n\tample.com\r\nCookie: \r\n\r\nsplits the Host header field.

The correct behavior would be to return a parsing error (-1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant