Title: [230267] trunk/Source/WebCore
Revision
230267
Author
[email protected]
Date
2018-04-04 11:26:24 -0700 (Wed, 04 Apr 2018)

Log Message

Remove unused HTTP header names
https://bugs.webkit.org/show_bug.cgi?id=184272

Reviewed by Alex Christensen.

No change of behavior.
Removed some names that are not used in the code base.
This allows to strengthen filtering of responses sent to WebProcess.
Added two headers used by web inspector.
Updated existing code to use indexed HTTP header names.

* html/parser/XSSAuditor.cpp:
(WebCore::XSSAuditor::init):
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::sourceMapURLForResource):
* platform/network/HTTPHeaderNames.in:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (230266 => 230267)


--- trunk/Source/WebCore/ChangeLog	2018-04-04 17:55:44 UTC (rev 230266)
+++ trunk/Source/WebCore/ChangeLog	2018-04-04 18:26:24 UTC (rev 230267)
@@ -1,3 +1,22 @@
+2018-04-04  Youenn Fablet  <[email protected]>
+
+        Remove unused HTTP header names
+        https://bugs.webkit.org/show_bug.cgi?id=184272
+
+        Reviewed by Alex Christensen.
+
+        No change of behavior.
+        Removed some names that are not used in the code base.
+        This allows to strengthen filtering of responses sent to WebProcess.
+        Added two headers used by web inspector.
+        Updated existing code to use indexed HTTP header names.
+
+        * html/parser/XSSAuditor.cpp:
+        (WebCore::XSSAuditor::init):
+        * inspector/agents/InspectorPageAgent.cpp:
+        (WebCore::InspectorPageAgent::sourceMapURLForResource):
+        * platform/network/HTTPHeaderNames.in:
+
 2018-04-04  Beth Dakin  <[email protected]>
 
         Fix the !HAVE(AVFOUNDATION_VIDEO_OUTPUT) build

Modified: trunk/Source/WebCore/html/parser/XSSAuditor.cpp (230266 => 230267)


--- trunk/Source/WebCore/html/parser/XSSAuditor.cpp	2018-04-04 17:55:44 UTC (rev 230266)
+++ trunk/Source/WebCore/html/parser/XSSAuditor.cpp	2018-04-04 18:26:24 UTC (rev 230267)
@@ -318,8 +318,7 @@
 
     String httpBodyAsString;
     if (RefPtr<DocumentLoader> documentLoader = document->frame()->loader().documentLoader()) {
-        static NeverDestroyed<String> XSSProtectionHeader(MAKE_STATIC_STRING_IMPL("X-XSS-Protection"));
-        String headerValue = documentLoader->response().httpHeaderField(XSSProtectionHeader);
+        String headerValue = documentLoader->response().httpHeaderField(HTTPHeaderName::XXSSProtection);
         String errorDetails;
         unsigned errorPosition = 0;
         String parsedReportURL;

Modified: trunk/Source/WebCore/inspector/agents/InspectorPageAgent.cpp (230266 => 230267)


--- trunk/Source/WebCore/inspector/agents/InspectorPageAgent.cpp	2018-04-04 17:55:44 UTC (rev 230266)
+++ trunk/Source/WebCore/inspector/agents/InspectorPageAgent.cpp	2018-04-04 18:26:24 UTC (rev 230267)
@@ -141,9 +141,6 @@
 
 String InspectorPageAgent::sourceMapURLForResource(CachedResource* cachedResource)
 {
-    static NeverDestroyed<String> sourceMapHTTPHeader(MAKE_STATIC_STRING_IMPL("SourceMap"));
-    static NeverDestroyed<String> sourceMapHTTPHeaderDeprecated(MAKE_STATIC_STRING_IMPL("X-SourceMap"));
-
     if (!cachedResource)
         return String();
 
@@ -151,11 +148,11 @@
     if (cachedResource->type() != CachedResource::CSSStyleSheet)
         return String();
 
-    String sourceMapHeader = cachedResource->response().httpHeaderField(sourceMapHTTPHeader);
+    String sourceMapHeader = cachedResource->response().httpHeaderField(HTTPHeaderName::SourceMap);
     if (!sourceMapHeader.isEmpty())
         return sourceMapHeader;
 
-    sourceMapHeader = cachedResource->response().httpHeaderField(sourceMapHTTPHeaderDeprecated);
+    sourceMapHeader = cachedResource->response().httpHeaderField(HTTPHeaderName::XSourceMap);
     if (!sourceMapHeader.isEmpty())
         return sourceMapHeader;
 

Modified: trunk/Source/WebCore/platform/network/HTTPHeaderNames.in (230266 => 230267)


--- trunk/Source/WebCore/platform/network/HTTPHeaderNames.in	2018-04-04 17:55:44 UTC (rev 230266)
+++ trunk/Source/WebCore/platform/network/HTTPHeaderNames.in	2018-04-04 18:26:24 UTC (rev 230267)
@@ -37,7 +37,6 @@
 Access-Control-Request-Headers
 Access-Control-Request-Method
 Age
-Alternate-Protocol
 Authorization
 Cache-Control
 Connection
@@ -48,7 +47,6 @@
 Content-Security-Policy
 Content-Security-Policy-Report-Only
 Content-Type
-Content-Transfer-Encoding
 Content-Range
 Cookie
 Cookie2
@@ -67,8 +65,8 @@
 Keep-Alive
 Last-Event-ID
 Last-Modified
+Link
 Location
-Link
 Origin
 Ping-From
 Ping-To
@@ -84,10 +82,10 @@
 Sec-WebSocket-Key
 Sec-WebSocket-Protocol
 Sec-WebSocket-Version
-Server
 Service-Worker-Allowed
 Set-Cookie
 Set-Cookie2
+SourceMap
 TE
 Timing-Allow-Origin
 Trailer
@@ -97,19 +95,14 @@
 User-Agent
 Vary
 Via
-X-Check-Cacheable
 X-Content-Type-Options
 X-DNS-Prefetch-Control
 X-Frame-Options
-X-Powered-By
+X-SourceMap
 X-WebKit-CSP
 X-WebKit-CSP-Report-Only
 X-XSS-Protection
 
 // These headers are specific to GStreamer.
-Icy-Genre
 Icy-MetaInt
 Icy-Metadata
-Icy-Name
-Icy-Title
-Icy-URL
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to