From c4e5f5c7e7e9f7468dc247b7a5616ab8835918d3 Mon Sep 17 00:00:00 2001 From: jlippa Date: Sat, 4 Jun 2016 21:31:42 +0100 Subject: [PATCH] RFC 6455 4.2.1.4 case sensitivity fix This is a case sensitivity fix for the Connection header Upgrade value to make this part meet the requirement of IETF websocket RFC 6455 4.2.1.4: "A |Connection| header field that includes the token "Upgrade", treated as an ASCII case-insensitive value." --- src/WebSocketsServer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WebSocketsServer.cpp b/src/WebSocketsServer.cpp index 57e61e4..dbe0b34 100644 --- a/src/WebSocketsServer.cpp +++ b/src/WebSocketsServer.cpp @@ -590,7 +590,7 @@ void WebSocketsServer::handleHeader(WSclient_t * client, String * headerLine) { String headerValue = headerLine->substring(headerLine->indexOf(':') + 2); if(headerName.equalsIgnoreCase("Connection")) { - if(headerValue.indexOf("Upgrade") >= 0) { + if(headerValue.equalsIgnoreCase("Upgrade")) { client->cIsUpgrade = true; } } else if(headerName.equalsIgnoreCase("Upgrade")) {