I'm developing a Rails 7 app, with some ActionCable elements, deployed for development and small-scale production to fly.io.
In most places, client browsers request /cable and are succesfully upgraded to websocket connections (101 Switching Protocols).
Some (and only some) clients operating on corporate/education networks where filters are installed appear to strip the Connection: Upgrade header and Upgrade: websocket headers from the request. The server returns a 404 status.
Please - is it possible and/or wise to always return a 101 Switching Protocols response when clients request /cable, regardless of headers? How would I do so?
Thanks
Non-filtered request received by server:
Host: ----redacted---.ngrok-free.app
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9,fr;q=0.8
Cache-Control: no-cache
Connection: Upgrade
Cookie: abuse_interstitial=----redacted----.ngrok-free.app; _app_session=****
Origin: https://----redacted---.ngrok-free.app
Pragma: no-cache
Sec-Websocket-Extensions: permessage-deflate; client_max_window_bits
Sec-Websocket-Key: T6M2yfBO+jDZq2aJ7puNbg==
Sec-Websocket-Protocol: actioncable-v1-json, actioncable-unsupported
Sec-Websocket-Version: 13
Upgrade: websocket
X-Forwarded-For: ip-address.
X-Forwarded-Proto: https
Response (101):
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Accept: 0DFGwUPxYaVFD8g+g1Q7dJDlCc4=
Sec-WebSocket-Protocol: actioncable-v1-json
Filtered request:
Host: ----redacted---.ngrok-free.app
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36
Accept-Encoding: gzip, deflate
Accept-Language: en-GB,en-US;q=0.9,en;q=0.8
Cache-Control: no-cache
Cookie: abuse_interstitial=----redacted---.ngrok-free.app.ngrok-free.app; app_session=*
Origin: ----redacted---.ngrok-free.app
Pragma: no-cache
Sec-Websocket-Extensions: permessage-deflate; client_max_window_bits
Sec-Websocket-Key: BknrG6brUONSl2ND+xD3xg==
Sec-Websocket-Protocol: actioncable-v1-json, actioncable-unsupported
Sec-Websocket-Version: 13
Via: 1.1 smoothwall.clientname.local (Smoothwall Guardian 3)
X-Forwarded-For: ip-address
X-Forwarded-Proto: https
Response (404):
Content-Type: text/plain
Cache-Control: no-cache
X-Request-Id: 6d4c66da-e916-4d1f-ba5b-48d7b886228f
X-Runtime: 0.024890
Server-Timing:
Transfer-Encoding: chunked
e
Page not found
0