This is an automated email from the ASF dual-hosted git repository.

markt-asf pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
     new 6d4f3c2e3b Review "Validate the server handshake response in the ... 
(#1114)"
6d4f3c2e3b is described below

commit 6d4f3c2e3bcf89dbf195ecab71c00d964d4aaaaa
Author: Mark Thomas <[email protected]>
AuthorDate: Thu Nov 5 18:08:07 2026 +0000

    Review "Validate the server handshake response in the ... (#1114)"
    
    HTTP header names are case insensitive
---
 java/org/apache/tomcat/websocket/WsWebSocketContainer.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/websocket/WsWebSocketContainer.java 
b/java/org/apache/tomcat/websocket/WsWebSocketContainer.java
index 585e7d3cda..1434d00f8d 100644
--- a/java/org/apache/tomcat/websocket/WsWebSocketContainer.java
+++ b/java/org/apache/tomcat/websocket/WsWebSocketContainer.java
@@ -709,7 +709,9 @@ public class WsWebSocketContainer implements 
WebSocketContainer, BackgroundProce
     private static Map<String,List<String>> createRequestHeaders(String host, 
int port, boolean secure,
             ClientEndpointConfig clientEndpointConfiguration) {
 
-        Map<String,List<String>> headers = new HashMap<>();
+        // HTTP header names are case-insensitive. A Configurator may modify 
these headers in beforeRequest() so the
+        // lookups used to validate the response must not depend on the case 
it uses.
+        Map<String,List<String>> headers = new CaseInsensitiveKeyMap<>();
         List<Extension> extensions = 
clientEndpointConfiguration.getExtensions();
         List<String> subProtocols = 
clientEndpointConfiguration.getPreferredSubprotocols();
         Map<String,Object> userProperties = 
clientEndpointConfiguration.getUserProperties();


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to