Title: [240158] trunk
Revision
240158
Author
aj...@chromium.org
Date
2019-01-18 10:44:54 -0800 (Fri, 18 Jan 2019)

Log Message

FetchResponse::url should return the empty string for tainted responses
https://bugs.webkit.org/show_bug.cgi?id=193553

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

* web-platform-tests/fetch/api/basic/mode-no-cors.sub.any.js:
(fetchNoCors):

Source/WebCore:

Check whether the response is tainted in FetchResponse::url, to match
the behavior described in https://fetch.spec.whatwg.org/#concept-filtered-response-opaque.

* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::url const):

LayoutTests:

* http/wpt/fetch/response-opaque-clone.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (240157 => 240158)


--- trunk/LayoutTests/ChangeLog	2019-01-18 18:37:11 UTC (rev 240157)
+++ trunk/LayoutTests/ChangeLog	2019-01-18 18:44:54 UTC (rev 240158)
@@ -1,3 +1,12 @@
+2019-01-18  Ali Juma  <aj...@chromium.org>
+
+        FetchResponse::url should return the empty string for tainted responses
+        https://bugs.webkit.org/show_bug.cgi?id=193553
+
+        Reviewed by Youenn Fablet.
+
+        * http/wpt/fetch/response-opaque-clone.html:
+
 2019-01-18  Jonathan Bedard  <jbed...@apple.com>
 
         webkitpy: Implement device type specific expected results (Follow-up fix)

Modified: trunk/LayoutTests/http/wpt/fetch/response-opaque-clone.html (240157 => 240158)


--- trunk/LayoutTests/http/wpt/fetch/response-opaque-clone.html	2019-01-18 18:37:11 UTC (rev 240157)
+++ trunk/LayoutTests/http/wpt/fetch/response-opaque-clone.html	2019-01-18 18:44:54 UTC (rev 240158)
@@ -16,6 +16,7 @@
     assert_equals(response.type, "opaque", testName + " type");
     assert_equals(response.status, 0, testName + " status");
     assert_equals(response.statusText, "", testName + " statusText");
+    assert_equals(response.url, "", testName + " url");
     assert_false(response.redirected, testName + " redirected");
     assert_true(response.headers.values().next().done, testName + " headers");
     assert_equals(response.body, null, testName + " opaque response body should be null");

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (240157 => 240158)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2019-01-18 18:37:11 UTC (rev 240157)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2019-01-18 18:44:54 UTC (rev 240158)
@@ -1,3 +1,13 @@
+2019-01-18  Ali Juma  <aj...@chromium.org>
+
+        FetchResponse::url should return the empty string for tainted responses
+        https://bugs.webkit.org/show_bug.cgi?id=193553
+
+        Reviewed by Youenn Fablet.
+
+        * web-platform-tests/fetch/api/basic/mode-no-cors.sub.any.js:
+        (fetchNoCors):
+
 2019-01-14  Charles Vazac  <cva...@akamai.com>
 
         Import current Resource-Timing WPTs

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/mode-no-cors.sub.any.js (240157 => 240158)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/mode-no-cors.sub.any.js	2019-01-18 18:37:11 UTC (rev 240157)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/mode-no-cors.sub.any.js	2019-01-18 18:44:54 UTC (rev 240158)
@@ -7,6 +7,7 @@
       return fetch(url + urlQuery, {"mode": "no-cors"}).then(function(resp) {
         assert_equals(resp.status, 0, "Opaque filter: status is 0");
         assert_equals(resp.statusText, "", "Opaque filter: statusText is \"\"");
+        assert_equals(resp.url, "", "Opaque filter: url is \"\"");
         assert_equals(resp.type , "opaque", "Opaque filter: response's type is opaque");
         assert_equals(resp.headers.get("x-is-filtered"), null, "Header x-is-filtered is filtered");
       });

Modified: trunk/Source/WebCore/ChangeLog (240157 => 240158)


--- trunk/Source/WebCore/ChangeLog	2019-01-18 18:37:11 UTC (rev 240157)
+++ trunk/Source/WebCore/ChangeLog	2019-01-18 18:44:54 UTC (rev 240158)
@@ -1,3 +1,16 @@
+2019-01-18  Ali Juma  <aj...@chromium.org>
+
+        FetchResponse::url should return the empty string for tainted responses
+        https://bugs.webkit.org/show_bug.cgi?id=193553
+
+        Reviewed by Youenn Fablet.
+
+        Check whether the response is tainted in FetchResponse::url, to match
+        the behavior described in https://fetch.spec.whatwg.org/#concept-filtered-response-opaque.
+
+        * Modules/fetch/FetchResponse.cpp:
+        (WebCore::FetchResponse::url const):
+
 2019-01-18  Youenn Fablet  <you...@apple.com>
 
         A track source should be unmuted whenever reenabled after setDirection changes

Modified: trunk/Source/WebCore/Modules/fetch/FetchResponse.cpp (240157 => 240158)


--- trunk/Source/WebCore/Modules/fetch/FetchResponse.cpp	2019-01-18 18:37:11 UTC (rev 240157)
+++ trunk/Source/WebCore/Modules/fetch/FetchResponse.cpp	2019-01-18 18:44:54 UTC (rev 240158)
@@ -247,7 +247,7 @@
 const String& FetchResponse::url() const
 {
     if (m_responseURL.isNull()) {
-        URL url = ""
+        URL url = ""
         url.removeFragmentIdentifier();
         m_responseURL = url.string();
     }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to