Skip to content

Commit beca562

Browse files
committed
Merge branch '6.1.x'
2 parents 65ac17e + c41f8ea commit beca562

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

spring-websocket/src/main/java/org/springframework/web/socket/server/support/WebSocketHandlerMapping.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import org.springframework.context.Lifecycle;
2323
import org.springframework.context.SmartLifecycle;
2424
import org.springframework.http.HttpHeaders;
25+
import org.springframework.http.HttpMethod;
2526
import org.springframework.lang.Nullable;
2627
import org.springframework.web.context.ServletContextAware;
2728
import org.springframework.web.servlet.HandlerExecutionChain;
@@ -127,7 +128,7 @@ private boolean matchWebSocketUpgrade(@Nullable Object handler, HttpServletReque
127128
handler = (handler instanceof HandlerExecutionChain chain ? chain.getHandler() : handler);
128129
if (this.webSocketUpgradeMatch && handler instanceof WebSocketHttpRequestHandler) {
129130
String header = request.getHeader(HttpHeaders.UPGRADE);
130-
return (request.getMethod().equals("GET") &&
131+
return (HttpMethod.GET.matches(request.getMethod()) &&
131132
header != null && header.equalsIgnoreCase("websocket"));
132133
}
133134
return true;

0 commit comments

Comments
 (0)