Title: [172295] branches/safari-600.1-branch/Source/WebCore

Diff

Modified: branches/safari-600.1-branch/Source/WebCore/ChangeLog (172294 => 172295)


--- branches/safari-600.1-branch/Source/WebCore/ChangeLog	2014-08-07 22:30:26 UTC (rev 172294)
+++ branches/safari-600.1-branch/Source/WebCore/ChangeLog	2014-08-07 22:34:30 UTC (rev 172295)
@@ -1,5 +1,31 @@
 2014-08-07  Dana Burkart <[email protected]>
 
+        Merge r172293
+
+    2014-08-07  Andy Estes  <[email protected]>
+
+            [Mac] Parental Controls content filter is mistakenly enabled for HTTP responses
+            https://bugs.webkit.org/show_bug.cgi?id=135730
+
+            Reviewed by Brady Eidson.
+
+            On the Mac, the WebFilterEvaluator (Parental Controls) content filter should only be enabled for HTTPS
+            responses. During iOS upstreaming we mistakenly enabled it for HTTP responses as well, and this causes HTTP
+            responses to be filtered twice -- once by the Parental Controls HTTP proxy and once by WebCore. Revert to the
+            pre-upstreaming behavior and only enable the content filter for HTTPS responses.
+
+            No new tests. Content filtering is not testable from WebKit.
+
+            * loader/DocumentLoader.cpp:
+            (WebCore::DocumentLoader::responseReceived): Passed the response to ContentFilter::canHandleResponse().
+            * platform/ContentFilter.h:
+            * platform/mac/ContentFilterMac.mm:
+            (WebCore::ContentFilter::canHandleResponse): Renamed from isEnabled(). Checks the response's scheme on Mac to
+            determine whether WebFilterEvaluator should be used.
+            (WebCore::ContentFilter::isEnabled): Deleted.
+
+2014-08-07  Dana Burkart <[email protected]>
+
         Merge r172291
 
     2014-08-07  Beth Dakin  <[email protected]>

Modified: branches/safari-600.1-branch/Source/WebCore/loader/DocumentLoader.cpp (172294 => 172295)


--- branches/safari-600.1-branch/Source/WebCore/loader/DocumentLoader.cpp	2014-08-07 22:30:26 UTC (rev 172294)
+++ branches/safari-600.1-branch/Source/WebCore/loader/DocumentLoader.cpp	2014-08-07 22:34:30 UTC (rev 172295)
@@ -663,7 +663,7 @@
 #endif
 
 #if USE(CONTENT_FILTERING)
-    if (response.url().protocolIsInHTTPFamily() && ContentFilter::isEnabled())
+    if (ContentFilter::canHandleResponse(response))
         m_contentFilter = std::make_unique<ContentFilter>(response);
 #endif
 

Modified: branches/safari-600.1-branch/Source/WebCore/platform/ContentFilter.h (172294 => 172295)


--- branches/safari-600.1-branch/Source/WebCore/platform/ContentFilter.h	2014-08-07 22:30:26 UTC (rev 172294)
+++ branches/safari-600.1-branch/Source/WebCore/platform/ContentFilter.h	2014-08-07 22:34:30 UTC (rev 172295)
@@ -57,7 +57,7 @@
 
 class ContentFilter {
 public:
-    static bool isEnabled();
+    static bool canHandleResponse(const ResourceResponse&);
 
     explicit ContentFilter(const ResourceResponse&);
     ~ContentFilter();

Modified: branches/safari-600.1-branch/Source/WebCore/platform/mac/ContentFilterMac.mm (172294 => 172295)


--- branches/safari-600.1-branch/Source/WebCore/platform/mac/ContentFilterMac.mm	2014-08-07 22:30:26 UTC (rev 172294)
+++ branches/safari-600.1-branch/Source/WebCore/platform/mac/ContentFilterMac.mm	2014-08-07 22:34:30 UTC (rev 172295)
@@ -124,13 +124,23 @@
 #endif
 }
 
-bool ContentFilter::isEnabled()
+bool ContentFilter::canHandleResponse(const ResourceResponse& response)
 {
-    return [getWebFilterEvaluatorClass() isManagedSession]
+    if (!response.url().protocolIsInHTTPFamily())
+        return false;
+
+    if ([getWebFilterEvaluatorClass() isManagedSession]) {
+#if PLATFORM(MAC)
+        if (response.url().protocolIs("https"))
+#endif
+            return true;
+    }
+
 #if HAVE(NE_FILTER_SOURCE)
-        || [getNEFilterSourceClass() filterRequired]
+    return [getNEFilterSourceClass() filterRequired];
+#else
+    return false;
 #endif
-    ;
 }
 
 void ContentFilter::addData(const char* data, int length)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to