OLD | NEW |
---|---|
(Empty) | |
1 <?php | |
2 header('X-ServiceWorker-ServerHeader: SetInTheServer'); | |
3 if (isset($_GET['ACAOrigin'])) { | |
4 $origins = explode(',', $_GET['ACAOrigin']); | |
5 for ($i = 0; $i < sizeof($origins); ++$i) | |
6 header("Access-Control-Allow-Origin: " . $origins[$i], false); | |
falken
2014/07/25 05:41:29
this looks indented too much
horo
2014/07/25 06:00:56
Done.
| |
7 } | |
8 | |
9 if (isset($_GET['ACAHeaders'])) | |
10 header("Access-Control-Allow-Headers: {$_GET['ACAHeaders']}"); | |
11 if (isset($_GET['ACAMethods'])) | |
12 header("Access-Control-Allow-Methods: {$_GET['ACAMethods']}"); | |
13 if (isset($_GET['ACACredentials'])) | |
14 header("Access-Control-Allow-Credentials: {$_GET['ACACredentials']}"); | |
15 if (isset($_GET['ACEHeaders'])) | |
16 header("Access-Control-Expose-Headers: {$_GET['ACEHeaders']}"); | |
17 | |
18 if ((isset($_GET['Auth']) and !isset($_SERVER['PHP_AUTH_USER'])) || isset($_GET[ 'AuthFail'])) { | |
19 header('WWW-Authenticate: Basic realm="Restricted"'); | |
20 header('HTTP/1.0 401 Unauthorized'); | |
21 echo 'Authentication canceled'; | |
22 exit; | |
23 } | |
24 | |
25 header('Content-Type: application/json'); | |
26 $arr = array('jsonpResult' => 'success', | |
27 'method' => $_SERVER['REQUEST_METHOD'], | |
28 'headers' => getallheaders(), | |
29 'username' => $_SERVER['PHP_AUTH_USER'], | |
30 'password' => $_SERVER['PHP_AUTH_PW']); | |
31 $json = json_encode($arr); | |
32 echo "report( $json );"; | |
33 ?> | |
OLD | NEW |