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

Unified Diff: LayoutTests/http/tests/xmlhttprequest/resources/access-control-allow-lists.php

Issue 109773002: Improve precision of error messages from failed CORS checks. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years 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/access-control-allow-lists.php
diff --git a/LayoutTests/http/tests/xmlhttprequest/resources/access-control-allow-lists.php b/LayoutTests/http/tests/xmlhttprequest/resources/access-control-allow-lists.php
index 8f0af5cf3ed088c58316c9158323806dec938536..e28fda8cbe648b4b11021ce6cb67dbe9c185b85d 100644
--- a/LayoutTests/http/tests/xmlhttprequest/resources/access-control-allow-lists.php
+++ b/LayoutTests/http/tests/xmlhttprequest/resources/access-control-allow-lists.php
@@ -1,9 +1,12 @@
<?php
-$origin = $_GET['origin'];
-
-if ($origin != 'none')
- header("Access-Control-Allow-Origin: $origin");
+if (isset($_GET['origin'])) {
+ header("Access-Control-Allow-Origin: " . $_GET['origin']);
+} else if (isset($_GET['origins'])) {
+ $origins = explode(',', $_GET['origins']);
+ for ($i = 0; $i < sizeof($origins); ++$i)
+ header("Access-Control-Allow-Origin: " . $origins[$i], false);
+}
if (isset($_GET['headers']))
header("Access-Control-Allow-Headers: {$_GET['headers']}");

Powered by Google App Engine
This is Rietveld 408576698