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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/security/suborigins/resources/fetch-resource.php

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/fetch-resource.php
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/suborigins/resources/fetch-resource.php b/third_party/WebKit/LayoutTests/http/tests/security/suborigins/resources/fetch-resource.php
new file mode 100644
index 0000000000000000000000000000000000000000..4039ea02989d1cf98bb068dc12b76bd4aee1559e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/security/suborigins/resources/fetch-resource.php
@@ -0,0 +1,22 @@
+<?php
+if ($_GET["suborigin"]) {
+ header("Suborigin: " . $_GET["suborigin"]);
+}
+?>
+<!DOCTYPE html>
+<html>
+<script>
+var id = '<?php echo($_GET["id"]); ?>';
+var resource_url = '<?php echo($_GET["resource"]); ?>'
+
+var is_mem_cached = window.internals.isLoadingFromMemoryCache(resource_url);
+
+fetch(resource_url, {mode: 'no-cors'})
+.then(function(response) {
+ window.parent.postMessage({'type': 'response', 'is_mem_cached': is_mem_cached, 'id': id}, '*');
+})
+.catch(function(e) {
+ window.parent.postMessage({'type': 'error', 'is_mem_cached': is_mem_cached, 'id': id}, '*')
+});
+</script>
+</html>

Powered by Google App Engine
This is Rietveld 408576698