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

Unified Diff: LayoutTests/http/tests/xmlhttprequest/resources/redirect-cors-origin-null.php

Issue 20735002: CORS: Fix the handling of redirected request containing Origin null. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 5 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: LayoutTests/http/tests/xmlhttprequest/resources/redirect-cors-origin-null.php
diff --git a/LayoutTests/http/tests/xmlhttprequest/resources/redirect-cors-origin-null.php b/LayoutTests/http/tests/xmlhttprequest/resources/redirect-cors-origin-null.php
new file mode 100755
index 0000000000000000000000000000000000000000..52f24e9915439b356d7021bd6e82feec67c97895
--- /dev/null
+++ b/LayoutTests/http/tests/xmlhttprequest/resources/redirect-cors-origin-null.php
@@ -0,0 +1,11 @@
+<?php
+ $request_origin_value = $_SERVER["HTTP_ORIGIN"];
+
+ if ($_SERVER['REQUEST_METHOD'] == "GET") {
+ header("HTTP/1.1 302");
+ header("Location: http://localhost:8000/xmlhttprequest/resources/redirect-cors-origin-null-pass.php");
+ }
+ if (!is_null($request_origin_value)) {
+ header("Access-Control-Allow-Origin: $request_origin_value");
+ }
+?>

Powered by Google App Engine
This is Rietveld 408576698