Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix multiple websocket connection issues. (#58)
- The websocket client sends two Connection headers: HTTP/1.1 GET / Host: 127.0.0.1 Origin: foo.com Content-Length: 0 Connection: Upgrade Upgrade: websocket Sec-WebSocket-Version: 13 Sec-WebSocket-Key: h57ZiKx+KAwmKbB+mxR8Ag== Connection: Keep-Alive The last "Connection: Keep-Alive" is added because the ConnectionType enum does not have an "Upgrade" variant. Adding the variant prevents this issue. - If the websocket client does not receive a "Content-Length: 0" header in the server's response, an error is returned stating "Unknown body type in a response with a Keep-Alive connection. This is not allowed." This occurs with the example client using the "websockets.chilkat.io/" service. This is corrected by assuming a "BodyType::ContentLen(0)" for the response when no other BodyType is provided and the "Connection: Upgrade" header is present.
- Loading branch information