Skip to content

Commit

Permalink
Merge branch '6.1.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
snicoll committed Oct 4, 2024
2 parents 65ac17e + c41f8ea commit beca562
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.springframework.context.Lifecycle;
import org.springframework.context.SmartLifecycle;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.lang.Nullable;
import org.springframework.web.context.ServletContextAware;
import org.springframework.web.servlet.HandlerExecutionChain;
Expand Down Expand Up @@ -127,7 +128,7 @@ private boolean matchWebSocketUpgrade(@Nullable Object handler, HttpServletReque
handler = (handler instanceof HandlerExecutionChain chain ? chain.getHandler() : handler);
if (this.webSocketUpgradeMatch && handler instanceof WebSocketHttpRequestHandler) {
String header = request.getHeader(HttpHeaders.UPGRADE);
return (request.getMethod().equals("GET") &&
return (HttpMethod.GET.matches(request.getMethod()) &&
header != null && header.equalsIgnoreCase("websocket"));
}
return true;
Expand Down

0 comments on commit beca562

Please sign in to comment.