[Content Filtering] Only pass http(s) requests to -[NEFilterSource willSendRequest...
authoraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Apr 2015 05:24:21 +0000 (05:24 +0000)
committeraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Apr 2015 05:24:21 +0000 (05:24 +0000)
https://bugs.webkit.org/show_bug.cgi?id=143437

Reviewed by Dan Bernstein.

No new tests. We can't test NEFilterSource directly.

* platform/cocoa/NetworkExtensionContentFilter.mm:
(WebCore::NetworkExtensionContentFilter::willSendRequest): Immediately allow requests with url schemes other than http and https.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@182377 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/cocoa/NetworkExtensionContentFilter.mm

index 477c97d..9752202 100644 (file)
@@ -1,3 +1,15 @@
+2015-04-05  Andy Estes  <aestes@apple.com>
+
+        [Content Filtering] Only pass http(s) requests to -[NEFilterSource willSendRequest:...]
+        https://bugs.webkit.org/show_bug.cgi?id=143437
+
+        Reviewed by Dan Bernstein.
+
+        No new tests. We can't test NEFilterSource directly.
+
+        * platform/cocoa/NetworkExtensionContentFilter.mm:
+        (WebCore::NetworkExtensionContentFilter::willSendRequest): Immediately allow requests with url schemes other than http and https.
+
 2015-04-05  Darin Adler  <darin@apple.com>
 
         FrameView code uses page() without null checking
index 91e3d5b..5936801 100644 (file)
@@ -76,6 +76,11 @@ void NetworkExtensionContentFilter::willSendRequest(ResourceRequest& request, co
 {
 #if HAVE(MODERN_NE_FILTER_SOURCE)
     ASSERT(!request.isNull());
+    if (!request.url().protocolIsInHTTPFamily()) {
+        m_status = NEFilterSourceStatusPass;
+        return;
+    }
+
     if (!redirectResponse.isNull()) {
         responseReceived(redirectResponse);
         if (!needsMoreData())