Skip to content
New issue

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

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

Already on GitHub? # to your account

Incorrect whitespace handling in header parsing #301

Closed
zaphoyd opened this issue Oct 24, 2013 · 0 comments
Closed

Incorrect whitespace handling in header parsing #301

zaphoyd opened this issue Oct 24, 2013 · 0 comments

Comments

@zaphoyd
Copy link
Owner

zaphoyd commented Oct 24, 2013

Per Wolfram Schroers on the mailing list:

The header in a HTTP response from the server contains key-value pairs, e.g.

HTTP/1.1 101 Switching Protocols
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Accept:ne1Cn3Pig3Bqgn6+CUWjDKC8/LE=

According to section 1.3 in RFC6455 the syntax of header fields follows the specification in section 4.2 in RFC 2616. The latter says

[...] Each header field consists

of a name followed by a colon (":") and the field value. Field names
are case-insensitive. The field value MAY be preceded by any amount
of LWS, though a single SP is preferred.

Expected behavior: The above HTTP response is valid.

Observed behavior: The above response causes the connection to fail. Only after adding a space after the colon in the last line (Sec-WebSocket-Accept: ne1Cn3Pig3Bqgn6+CUWjDKC8/LE=) a valid connection is established.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

1 participant