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

Side by Side Diff: LayoutTests/http/tests/security/resources/cors-script.php

Issue 984213002: CORS errors print error twice on preload. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added delay to cors-script.php Created 5 years, 9 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 unified diff | Download patch
OLDNEW
1 <?php 1 <?php
2 if (strtolower($_GET["cors"]) != "false") { 2 if (strtolower($_GET["cors"]) != "false") {
3 header("Access-Control-Allow-Origin: http://127.0.0.1:8000"); 3 header("Access-Control-Allow-Origin: http://127.0.0.1:8000");
4 } 4 }
5 if (strtolower($_GET["credentials"]) == "true") { 5 if (strtolower($_GET["credentials"]) == "true") {
6 header("Access-Control-ALlow-Credentials: true"); 6 header("Access-Control-ALlow-Credentials: true");
7 } 7 }
8 header("Content-Type: application/javascript"); 8 header("Content-Type: application/javascript");
9 $delay = $_GET['delay'];
10 if ($delay)
11 usleep(1000 * $delay);
9 $value = $_GET['value']; 12 $value = $_GET['value'];
10 if ($_SERVER['HTTP_ORIGIN'] && $_GET['value_cors']) { 13 if ($_SERVER['HTTP_ORIGIN'] && $_GET['value_cors']) {
11 $value = $_GET['value_cors']; 14 $value = $_GET['value_cors'];
12 } 15 }
13 if ($value) 16 if ($value)
14 echo "result = \"" . $value . "\";"; 17 echo "result = \"" . $value . "\";";
15 else if (strtolower($_GET["fail"]) == "true") 18 else if (strtolower($_GET["fail"]) == "true")
16 echo "throw({toString: function(){ return 'SomeError' }});"; 19 echo "throw({toString: function(){ return 'SomeError' }});";
17 else 20 else
18 echo "alert('script ran.');"; 21 echo "alert('script ran.');";
19 ?> 22 ?>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698