Index: third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/foreign-fetch-cors-worker.js |
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/foreign-fetch-cors-worker.js b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/foreign-fetch-cors-worker.js |
similarity index 83% |
rename from third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/foreign-fetch-cors-worker.js |
rename to third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/foreign-fetch-cors-worker.js |
index 1b819ceed2a09fb046f14968a6b080f55e749a6d..36c7b9de52d7ff8deaa1ff562488261a837d801c 100644 |
--- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/foreign-fetch-cors-worker.js |
+++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/foreign-fetch-cors-worker.js |
@@ -1,4 +1,4 @@ |
-importScripts('../../resources/get-host-info.js'); |
+importScripts('get-host-info.sub.js'); |
var host_info = get_host_info(); |
self.addEventListener('install', function(event) { |
@@ -9,10 +9,10 @@ self.addEventListener('foreignfetch', function(event) { |
var response = JSON.parse(decodeURIComponent(location.search.substring(1))); |
var url = new URL(event.request.url); |
var params = JSON.parse(decodeURIComponent(url.search.substring(1))); |
- var url_to_fetch = 'fetch-access-control.php?'; |
+ var url_to_fetch = 'fetch-access-control.py?'; |
if (params.cross_origin) { |
url_to_fetch = |
- host_info.HTTPS_ORIGIN + '/serviceworker/resources/' + url_to_fetch; |
+ host_info.HTTPS_ORIGIN + new URL('./', location).pathname + url_to_fetch; |
} |
if (params.with_aceheaders) |
url_to_fetch += 'ACEHeaders=X-ServiceWorker-ServerHeader&'; |