Skip to content

Remove content length header on initial handshake

Compare
Choose a tag to compare
@VaporBot VaporBot released this 28 Mar 17:04
· 27 commits to main since this release
e32033a
This patch was authored by @GNMoseke and released by @0xTim.

This removes the content-length: 0 header being automatically applied to outgoing websocket handshakes.

As per RFC 7230 Section 3.3.2:

A user agent SHOULD NOT send a
Content-Length header field when the request message does not contain
a payload body and the method semantics do not anticipate such a
body.

This was causing issues with certain cloud providers, most notably Google Cloud Run, that would force close the websocket as soon as data was received from a client.