mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-17 16:39:29 +00:00
Update exception messages in HandshakeWebSocketService
Closes gh-37023
This commit is contained in:
committed by
Brian Clozel
parent
ea3e61fd2f
commit
b4d9b514f5
+2
-2
@@ -195,12 +195,12 @@ public class HandshakeWebSocketService implements WebSocketService, Lifecycle {
|
||||
|
||||
if (HttpMethod.GET == method) {
|
||||
if (!"WebSocket".equalsIgnoreCase(headers.getUpgrade())) {
|
||||
return handleBadRequest(exchange, "Invalid 'Upgrade' header: " + headers);
|
||||
return handleBadRequest(exchange, "Can \"Upgrade\" only to \"WebSocket\".");
|
||||
}
|
||||
|
||||
List<String> connectionValue = headers.getConnection();
|
||||
if (!connectionValue.contains("Upgrade") && !connectionValue.contains("upgrade")) {
|
||||
return handleBadRequest(exchange, "Invalid 'Connection' header: " + headers);
|
||||
return handleBadRequest(exchange, "\"Connection\" must be \"upgrade\".");
|
||||
}
|
||||
|
||||
String key = headers.getFirst(SEC_WEBSOCKET_KEY);
|
||||
|
||||
Reference in New Issue
Block a user