Open chrisociepa opened 3 years ago
I found a workaround removing a client request header:
builder.routes()
.route(r -> r.path(myServicePath).filters(f -> f.removeRequestHeader("Sec-WebSocket-Protocol")).uri(serviceUrl))
.build();
But any other cleaner way would be appreciated.
I'm a bit confused as to what is wrong? Are you suggesting gateway should remove the Sec-WebSocket-Protocol
automatically?
I'm not sure what is the best way to solve this issue. If my workaround with removing the header is the best option that we have then fine. I wondered if this case could be handled out of the box by ignoring missing header and not failing the handshake stage. From the other hand I understand it might be 3rd party libraries problem. I experienced this problem with Microsoft services, so I thought that more people might reach the same problem
My very simple gateway app throws an WebSocketClientHandshakeException exception when a destination server responses without Sec-WebSocket-Protocol header during handshake.
spring-cloud-starter-gateway
version3.0.1
spring-core
version5.3.4
An example of client request headers:
and the server response headers:
The stacktrace:
Is there any way to patch or workaround this problem?