OLD | NEW |
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']; | 9 $delay = $_GET['delay']; |
10 if ($delay) | 10 if ($delay) |
11 usleep(1000 * $delay); | 11 usleep(1000 * $delay); |
12 $value = $_GET['value']; | 12 $value = $_GET['value']; |
13 if ($_SERVER['HTTP_ORIGIN'] && $_GET['value_cors']) { | 13 if ($_SERVER['HTTP_ORIGIN'] && $_GET['value_cors']) { |
14 $value = $_GET['value_cors']; | 14 $value = $_GET['value_cors']; |
15 } | 15 } |
16 if ($value) | 16 if ($value) |
17 echo "result = \"" . $value . "\";"; | 17 echo "result = \"" . $value . "\";"; |
18 else if (strtolower($_GET["fail"]) == "true") | 18 else if (strtolower($_GET["fail"]) == "true") |
19 echo "throw({toString: function(){ return 'SomeError' }});"; | 19 echo "throw({toString: function(){ return 'SomeError' }});"; |
20 else | 20 else |
21 echo "alert('script ran.');"; | 21 echo "alert('script ran.');"; |
22 ?> | 22 ?> |
OLD | NEW |