socketry / async-websocket

Asynchronous WebSocket client and server, supporting HTTP/1 and HTTP/2 for Ruby.
MIT License
166 stars 18 forks source link

Compare protocols case-insensitively #67

Closed ryu-sato closed 2 months ago

ryu-sato commented 4 months ago

This PR allows the protocol header of the "101 Switching Protocols" response received from the Websocket server to be compared case-insensitive.

Case-insensitive comparison is because the RFC states that it should be done so.

ref. https://www.rfc-editor.org/rfc/rfc9110.html#name-upgrade

Although protocol names are registered with a preferred case, recipients SHOULD use case-insensitive comparison when matching each protocol-name to supported protocols.

Types of Changes

Contribution

ioquatix commented 2 months ago

Thanks for your contribution.