ninenines / gun

HTTP/1.1, HTTP/2, Websocket client (and more) for Erlang/OTP.
ISC License
898 stars 231 forks source link

Fix invalid stream reference in `gun_data` message for rejected websocket upgrade #181

Closed pbober closed 5 years ago

pbober commented 5 years ago

When a server rejects a websocket upgrade request and sends a response body, gun doesn't strip the stream reference (set to {websocket, ...}) in the gun_data message. This breaks matching the StreamRef value in these messages.

I added a unit test for this case (it seems that the Autobahn suite doesn't verify it).

essen commented 5 years ago

Good find! Thanks. I'll review and merge over the holidays.

essen commented 5 years ago

Merged locally, thanks!

pbober commented 5 years ago

Thanks! Are you planning a new gun release any time soon?

essen commented 5 years ago

Working on 2.0. Probably at least a few weeks off.