Diff
Modified: branches/safari-605-branch/LayoutTests/ChangeLog (227541 => 227542)
--- branches/safari-605-branch/LayoutTests/ChangeLog 2018-01-24 20:15:49 UTC (rev 227541)
+++ branches/safari-605-branch/LayoutTests/ChangeLog 2018-01-24 20:15:52 UTC (rev 227542)
@@ -1,5 +1,20 @@
2018-01-24 Jason Marcell <jmarc...@apple.com>
+ Cherry-pick r227531. rdar://problem/36830355
+
+ 2018-01-24 Youenn Fablet <you...@apple.com>
+
+ Fetch response should copy its url from the request if null
+ https://bugs.webkit.org/show_bug.cgi?id=182048
+
+ Reviewed by Chris Dumez.
+
+ * http/tests/workers/service/basic-fetch.https-expected.txt:
+ * http/tests/workers/service/resources/basic-fetch.js:
+ (async.test):
+
+2018-01-24 Jason Marcell <jmarc...@apple.com>
+
Cherry-pick r227479. rdar://problem/36830349
2018-01-23 Wenson Hsieh <wenson_hs...@apple.com>
Modified: branches/safari-605-branch/LayoutTests/http/tests/workers/service/basic-fetch.https-expected.txt (227541 => 227542)
--- branches/safari-605-branch/LayoutTests/http/tests/workers/service/basic-fetch.https-expected.txt 2018-01-24 20:15:49 UTC (rev 227541)
+++ branches/safari-605-branch/LayoutTests/http/tests/workers/service/basic-fetch.https-expected.txt 2018-01-24 20:15:52 UTC (rev 227542)
@@ -1,12 +1,15 @@
+test1 url: https://127.0.0.1:8443/workers/service/resources/test1
test1 status code: 200
test1 status text: Hello from service worker
test1 header Hello: World
test1 source: Service worker
+test2 url: https://127.0.0.1:8443/workers/service/resources/test2
test2 status code: 500
test2 status text: Error from service worker
test2 source: Service worker
PASS: test3 fetch failed as expected
+test4 url: https://127.0.0.1:8443/workers/service/resources/test4
test4 status code: 404
PASS: test5 fetch failed as expected
PASS: / fetch failed as expected
Modified: branches/safari-605-branch/LayoutTests/http/tests/workers/service/resources/basic-fetch.js (227541 => 227542)
--- branches/safari-605-branch/LayoutTests/http/tests/workers/service/resources/basic-fetch.js 2018-01-24 20:15:49 UTC (rev 227541)
+++ branches/safari-605-branch/LayoutTests/http/tests/workers/service/resources/basic-fetch.js 2018-01-24 20:15:52 UTC (rev 227542)
@@ -5,6 +5,7 @@
var fetch = frame.contentWindow.fetch;
var response = await fetch("test1");
+ log("test1 url: " + response.url);
log("test1 status code: " + response.status);
log("test1 status text: " + response.statusText);
log("test1 header Hello: " + response.headers.get("hello"));
@@ -13,6 +14,7 @@
log("test1 source: " + internals.fetchResponseSource(response));
var response = await fetch("test2");
+ log("test2 url: " + response.url);
log("test2 status code: " + response.status);
log("test2 status text: " + response.statusText);
@@ -30,6 +32,7 @@
}
var response = await fetch("test4");
+ log("test4 url: " + response.url);
log("test4 status code: " + response.status);
try {
Modified: branches/safari-605-branch/Source/WebCore/ChangeLog (227541 => 227542)
--- branches/safari-605-branch/Source/WebCore/ChangeLog 2018-01-24 20:15:49 UTC (rev 227541)
+++ branches/safari-605-branch/Source/WebCore/ChangeLog 2018-01-24 20:15:52 UTC (rev 227542)
@@ -1,5 +1,21 @@
2018-01-24 Jason Marcell <jmarc...@apple.com>
+ Cherry-pick r227531. rdar://problem/36830355
+
+ 2018-01-24 Youenn Fablet <you...@apple.com>
+
+ Fetch response should copy its url from the request if null
+ https://bugs.webkit.org/show_bug.cgi?id=182048
+
+ Reviewed by Chris Dumez.
+
+ No change of behavior.
+
+ * loader/DocumentLoader.cpp:
+ (WebCore::DocumentLoader::responseReceived): Add assertion to check that the response URL is not null.
+
+2018-01-24 Jason Marcell <jmarc...@apple.com>
+
Cherry-pick r227525. rdar://problem/36830360
2018-01-24 Antti Koivisto <an...@apple.com>
Modified: branches/safari-605-branch/Source/WebCore/loader/DocumentLoader.cpp (227541 => 227542)
--- branches/safari-605-branch/Source/WebCore/loader/DocumentLoader.cpp 2018-01-24 20:15:49 UTC (rev 227541)
+++ branches/safari-605-branch/Source/WebCore/loader/DocumentLoader.cpp 2018-01-24 20:15:52 UTC (rev 227542)
@@ -751,6 +751,7 @@
} else if (response.isMultipart())
m_isLoadingMultipartContent = true;
+ ASSERT(!response.url().isNull());
m_response = response;
if (m_identifierForLoadWithoutResourceLoader) {
Modified: branches/safari-605-branch/Source/WebKit/ChangeLog (227541 => 227542)
--- branches/safari-605-branch/Source/WebKit/ChangeLog 2018-01-24 20:15:49 UTC (rev 227541)
+++ branches/safari-605-branch/Source/WebKit/ChangeLog 2018-01-24 20:15:52 UTC (rev 227542)
@@ -1,3 +1,17 @@
+2018-01-24 Jason Marcell <jmarc...@apple.com>
+
+ Cherry-pick r227531. rdar://problem/36830355
+
+ 2018-01-24 Youenn Fablet <you...@apple.com>
+
+ Fetch response should copy its url from the request if null
+ https://bugs.webkit.org/show_bug.cgi?id=182048
+
+ Reviewed by Chris Dumez.
+
+ * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
+ (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
+
2018-01-23 Jason Marcell <jmarc...@apple.com>
Cherry-pick r227457. rdar://problem/36807161
Modified: branches/safari-605-branch/Source/WebKit/WebProcess/Storage/ServiceWorkerClientFetch.cpp (227541 => 227542)
--- branches/safari-605-branch/Source/WebKit/WebProcess/Storage/ServiceWorkerClientFetch.cpp 2018-01-24 20:15:49 UTC (rev 227541)
+++ branches/safari-605-branch/Source/WebKit/WebProcess/Storage/ServiceWorkerClientFetch.cpp 2018-01-24 20:15:52 UTC (rev 227542)
@@ -136,6 +136,10 @@
}
response.setSource(ResourceResponse::Source::ServiceWorker);
+ // As per https://fetch.spec.whatwg.org/#main-fetch step 9, copy request's url list in response's url list if empty.
+ if (response.url().isNull())
+ response.setURL(m_loader->request().url());
+
m_loader->didReceiveResponse(response);
if (auto callback = WTFMove(m_callback))
callback(Result::Succeeded);