FredyH / GWSockets

WebSockets for GLua
MIT License
87 stars 7 forks source link

Failing websocket handshake with case-sensitive header value #38

Closed robilkot closed 10 months ago

robilkot commented 10 months ago

While performing websocket handshake with server, client sends header 'Connection' with value 'upgrade' instead of 'Upgrade'. Since values are case-sensitive, protocol switching may not be performed depending on server-side request processing (faced this issue while working with https://github.com/gilmaimon/ArduinoWebsockets). In comparison, Postman sends value 'Upgrade' and everything works just fine

FredyH commented 10 months ago

You are right that header values can be case sensitive. It is not our library that handles the upgrading of the HTTP connection, so we do not have access to change the case that is used. However, it seems like sending upgrade rather than Upgrade should work according to the standard, see the first example here.

In fact, the specification of the Connection header only specifies example values in lower case.

robilkot commented 10 months ago

Thanks for the answer. Interestingly, mdn also provides examples with upper-case 'Upgrade' here and down the link you sent