My client was mastodon(a decentralized social media like twitter) web and native apps.
My server was powered by fiber and websocket component was offical websocket middleware of fiber based on this amazing library.
The issue was websocket upgrade prediction websocket.IsWebSocketUpgrade(ctx) was always false.
I checked the request and dig into the source code, and found:
ws client sent request header with Upgrade: websocket, but the server side only return true when the value was Websocket.
Does it should convert the value of Upgrade header to same case before checking?
My client was mastodon(a decentralized social media like twitter) web and native apps. My server was powered by fiber and websocket component was offical websocket middleware of fiber based on this amazing library.
The issue was websocket upgrade prediction
websocket.IsWebSocketUpgrade(ctx)
was always false.I checked the request and dig into the source code, and found: ws client sent request header with
Upgrade: websocket
, but the server side only return true when the value wasWebsocket
.Does it should convert the value of
Upgrade
header to same case before checking?https://github.com/fasthttp/websocket/blob/c48d95b9f1b2dfaf28be1c828e7008a77da1dbba/server_fasthttp.go#L227