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.
This removes the
content-length: 0
header being automatically applied to outgoing websocket handshakes.As per RFC 7230 Section 3.3.2:
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.