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

Handle continuation HTTP headers correctly #40

Merged
merged 1 commit into from
Aug 30, 2013
Merged

Conversation

acg
Copy link
Contributor

@acg acg commented Jul 18, 2013

Currently, http_parser.parser joins continued header values together as a comma-separated list. According to the RFC continuation lines should instead be joined with a single space:

Any LWS that occurs between field-content MAY be replaced with a single SP before interpreting the field value or forwarding the message downstream.

If a header name is repeated, the values can be folded together into a comma-separated list. The current code handles this correctly.

But in either case, if the header value so far is empty, I don't think we should prepend the separator. So this:

X-Test:
X-Test: foo
X-Test: bar

Should be equivalent to

X-Test: foo, bar

Not

X-Test: , foo, bar

I've also attached a couple test suite functions for the continuation and repeated header cases.

benoitc added a commit that referenced this pull request Aug 30, 2013
Handle continuation HTTP headers correctly
@benoitc benoitc merged commit 84acb58 into benoitc:master Aug 30, 2013
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

Successfully merging this pull request may close these issues.

2 participants