Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Unified Diff: third_party/WebKit/LayoutTests/http/tests/security/suborigins/resources/sw-reject-all-with-error.js

Issue 2343053002: Service worker bypass for resource requests from suborigins (Closed)
Patch Set: Update to handle MemCache Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/http/tests/security/suborigins/resources/sw-reject-all-with-error.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/suborigins/resources/sw-reject-all-with-error.js b/third_party/WebKit/LayoutTests/http/tests/security/suborigins/resources/sw-reject-all-with-error.js
new file mode 100644
index 0000000000000000000000000000000000000000..258f6e0cb10ce1fc7a56ca70f030a32d2c6d2e57
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/security/suborigins/resources/sw-reject-all-with-error.js
@@ -0,0 +1,8 @@
+// This service worker, once installed, will reject all resource requests,
+// unless the resource has 'bypass' in the URL. For those URLs, it simply
+// passes through the request.
+self.addEventListener('fetch', function(event) {
+ if (event.request.url.indexOf('bypass') != -1)
+ event.respondWith(fetch.event.request);
falken 2016/09/20 03:48:57 BTW event.respondWith(request) and not calling res
jww 2016/09/20 04:27:47 Acknowledged.
+ event.respondWith(Promise.reject(Error("Rejecting all requests")));
falken 2016/09/20 03:48:57 I must be missing something but why are these reje
jww 2016/09/20 04:27:47 It's a little tricky with what's going on here, bu
+});

Powered by Google App Engine
This is Rietveld 408576698