File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
turms-gateway/src/main/java/im/turms/gateway/access/client/websocket Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change 1818package im .turms .gateway .access .client .websocket ;
1919
2020import java .net .InetSocketAddress ;
21- import java .util .List ;
2221import jakarta .annotation .Nullable ;
2322
2423import io .netty .buffer .ByteBuf ;
@@ -228,14 +227,13 @@ private static HttpResponseStatus validateHandshakeRequest(HttpServerRequest req
228227 + method
229228 + "' not supported" );
230229 }
231- if (!"WebSocket" . equalsIgnoreCase ( headers .get (UPGRADE ) )) {
230+ if (!headers .containsValue (UPGRADE , "websocket" , true )) {
232231 return new HttpResponseStatus (
233232 HttpResponseStatus .BAD_REQUEST .code (),
234233 "Invalid 'Upgrade' header: "
235234 + headers );
236235 }
237- List <String > connectionValue = headers .getAll (CONNECTION );
238- if (!connectionValue .contains ("Upgrade" ) && !connectionValue .contains ("upgrade" )) {
236+ if (!headers .containsValue (CONNECTION , "upgrade" , true )) {
239237 return new HttpResponseStatus (
240238 HttpResponseStatus .BAD_REQUEST .code (),
241239 "Invalid 'Connection' header: "
You can’t perform that action at this time.
0 commit comments