Title: [200219] trunk/Source/WebCore
Revision
200219
Author
[email protected]
Date
2016-04-28 18:07:38 -0700 (Thu, 28 Apr 2016)

Log Message

Allow non-standard HTTP headers in WebSocket handshake
https://bugs.webkit.org/show_bug.cgi?id=157157

Patch by John Wilander <[email protected]> on 2016-04-28
Reviewed by Brent Fulgham.

No new tests since https://bugs.webkit.org/show_bug.cgi?id=157095
tests that non-standard headers are allowed.

* Modules/websockets/WebSocketHandshake.cpp:
(WebCore::WebSocketHandshake::readHTTPHeaders):
    Changed from fail to allow for unrecognized headers.
    This was the behavior before https://bugs.webkit.org/show_bug.cgi?id=155602.
* platform/network/HTTPHeaderNames.in:
    Removed whitelisted legacy headers since we now allow all non-standard headers.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (200218 => 200219)


--- trunk/Source/WebCore/ChangeLog	2016-04-29 00:53:30 UTC (rev 200218)
+++ trunk/Source/WebCore/ChangeLog	2016-04-29 01:07:38 UTC (rev 200219)
@@ -1,3 +1,20 @@
+2016-04-28  John Wilander  <[email protected]>
+
+        Allow non-standard HTTP headers in WebSocket handshake
+        https://bugs.webkit.org/show_bug.cgi?id=157157
+
+        Reviewed by Brent Fulgham.
+
+        No new tests since https://bugs.webkit.org/show_bug.cgi?id=157095
+        tests that non-standard headers are allowed.
+
+        * Modules/websockets/WebSocketHandshake.cpp:
+        (WebCore::WebSocketHandshake::readHTTPHeaders):
+            Changed from fail to allow for unrecognized headers.
+            This was the behavior before https://bugs.webkit.org/show_bug.cgi?id=155602.
+        * platform/network/HTTPHeaderNames.in:
+            Removed whitelisted legacy headers since we now allow all non-standard headers.
+
 2016-04-27  Brent Fulgham  <[email protected]>
 
         Make sure we don't mishandle HTMLFrameOwnerElement lifecycle

Modified: trunk/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp (200218 => 200219)


--- trunk/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp	2016-04-29 00:53:30 UTC (rev 200218)
+++ trunk/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp	2016-04-29 01:07:38 UTC (rev 200219)
@@ -529,8 +529,9 @@
 
         HTTPHeaderName headerName;
         if (!findHTTPHeaderName(name, headerName)) {
-            m_failureReason = makeString("Unknown header name ", name, " in HTTP response");
-            return nullptr;
+            // Evidence in the wild shows that services make use of custom headers in the handshake
+            m_serverHandshakeResponse.addHTTPHeaderField(name.toString(), value);
+            continue;
         }
 
         // https://tools.ietf.org/html/rfc7230#section-3.2.4

Modified: trunk/Source/WebCore/platform/network/HTTPHeaderNames.in (200218 => 200219)


--- trunk/Source/WebCore/platform/network/HTTPHeaderNames.in	2016-04-29 00:53:30 UTC (rev 200218)
+++ trunk/Source/WebCore/platform/network/HTTPHeaderNames.in	2016-04-29 01:07:38 UTC (rev 200219)
@@ -108,10 +108,3 @@
 Icy-Name
 Icy-Title
 Icy-URL
-
-// These are specific to legacy WebSockets implementations
-// https://bugs.webkit.org/show_bug.cgi?id=157057
-Sec-WebSocket-Location
-Sec-WebSocket-Origin
-WebSocket-Location
-WebSocket-Origin
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to