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

Ignore response body during WebSocket handshake #9418

Merged
merged 1 commit into from
Jun 5, 2020

Conversation

waj
Copy link
Member

@waj waj commented Jun 3, 2020

HTTP response during WebSocket handler is not supposed to have a body. Still some servers might return malformed responses. That is the case of Slack that is returning this:

HTTP/1.1 101 Switching Protocols
upgrade: websocket
connection: upgrade
sec-websocket-accept: HYdFWxnjtSQ2eim/P3Qu/3Fud3s=
date: Wed, 03 Jun 2020 20:58:23 GMT
server: envoy
via: envoy-wss-iad-fg1t
transfer-encoding: chunked

That transfer-encoding header is making the parsing of the response to fail. This PR ensures the body is ignored.

@bcardiff bcardiff added this to the 0.35.0 milestone Jun 4, 2020
@bcardiff bcardiff merged commit 8a6988e into crystal-lang:master Jun 5, 2020
@waj waj deleted the fix/websocket-ignore-body branch June 8, 2020 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants