question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Websocket connections fails when headers are case sensitive

See original GitHub issue

Trying to access a third party web application having websocket connections through spring cloud gateway

All http requests are success but websocket connections fails with io.netty.handler.codec.http.websocketx.WebSocketClientHandshakeException: Invalid handshake response getStatus: 404

While examining the packets observed that request headers are sent in lower case letters (upgrade, connection and sec-websocket-key) from netty > io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker13

headers.set(HttpHeaderNames.UPGRADE, HttpHeaderValues.WEBSOCKET).set(HttpHeaderNames.CONNECTION, HttpHeaderValues.UPGRADE).set(HttpHeaderNames.SEC_WEBSOCKET_KEY, key);

Unfortunately the third party web application I am trying to access is expecting case sensitive headers. Is there a way I can override these headers?

Netty version : reactor-netty 1.0.8

JDK 1.8

OS : Ubuntu 20.04

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:16 (8 by maintainers)

github_iconTop GitHub Comments

4reactions
violetaggcommented, Jul 6, 2021

@slandelle @hyperxpro I had reported it to their technical team. In my scenario this third party application can be from vendors. So just want to make sure it doesn’t break even if it is not fixed in their end.

In my opinion the third party component that violates the RFC should be fixed

2reactions
slandellecommented, Jul 6, 2021

@Jerry29 You should report this issue to the broken third party application so they fix it instead of trying to fork the valid implementation in Netty.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Case-sensitive "connection" upgrade request header check ...
Case-sensitive "connection" upgrade request header check breaks WebSocket ... line 99: Error: The handshake request has incorrect Connection header.
Read more >
Nginx header Connection "upgrade" (lowercase) fails #55
According to the documentation (http://nginx.org/en/docs/http/websocket.html) setting the header Connection to upgrade should work, but it fails ...
Read more >
Spring Cloud gateway fails to establish websocket ...
I have a third party webapplication having websocket connections. It is expecting Upgrade, Connection header names to be case sensitive.
Read more >
Amazon API Gateway important notes
Header names and query parameters are processed in a case-sensitive way. The following table lists the headers that may be dropped, remapped, or...
Read more >
RFC Errata Report » RFC Editor
If the client already has a WebSocket connection to the remote host (IP ... conflicts with general HTTP semantics where this is case...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found