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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/resources/access-control-origin-header-in-isolated-world.php

Issue 2635023003: Fix a bug in origin header generation for CORS preflight in extensions (Closed)
Patch Set: Rebase Created 3 years, 11 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/xmlhttprequest/resources/access-control-origin-header-in-isolated-world.php
diff --git a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/resources/access-control-origin-header-in-isolated-world.php b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/resources/access-control-origin-header-in-isolated-world.php
new file mode 100644
index 0000000000000000000000000000000000000000..0556700a5fa44196b1637b0a5c6eaad94318da04
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/resources/access-control-origin-header-in-isolated-world.php
@@ -0,0 +1,13 @@
+<?php
+if ($_SERVER["HTTP_ORIGIN"] == "http://example.com") {
+ header("Access-Control-Allow-Origin: http://example.com");
+
+ if ($_SERVER["REQUEST_METHOD"] == "OPTIONS") {
+ header("Access-Control-Allow-Headers: X-Custom-Header");
+ } else {
+ print $_SERVER["HTTP_X_CUSTOM_HEADER"];
+ }
+} else {
+ header("HTTP/1.1 400");
+}
+?>

Powered by Google App Engine
This is Rietveld 408576698