OLD | NEW |
---|---|
(Empty) | |
1 <?php | |
2 require_once '../../resources/portabilityLayer.php'; | |
tyoshino (SeeGerritForStatus)
2015/01/29 10:44:53
is this needed?
hiroshige
2015/01/29 11:08:11
Removed. Also removed from *-lowercase.php, based
| |
3 | |
4 header("Access-Control-Allow-Origin: *"); | |
5 header("Access-Control-Max-Age: 0"); | |
6 | |
7 if ($_SERVER["REQUEST_METHOD"] == "OPTIONS") { | |
8 // Check that the names in Access-Control-Request-Headers are | |
9 // "in lexicographical order, each converted to ASCII lowercase". | |
10 // Spec: http://www.w3.org/TR/cors/#cross-origin-request-with-preflight-0 | |
tyoshino (SeeGerritForStatus)
2015/01/29 10:44:53
please cite fetch.spec.whatwg.org
hiroshige
2015/01/29 11:08:11
Done.
| |
11 if ($_SERVER["HTTP_ACCESS_CONTROL_REQUEST_HEADERS"] == | |
12 'x-custom-s, x-custom-test, x-custom-u, x-custom-ua, x-custom-v') { | |
13 header("Access-Control-Allow-Headers: x-custom-s, x-custom-test, x-custo m-u, x-custom-ua, x-custom-v"); | |
14 } else { | |
15 header("HTTP/1.1 400"); | |
tyoshino (SeeGerritForStatus)
2015/01/29 10:44:53
does this work even after calling header() emittin
hiroshige
2015/01/29 11:08:11
Done.
| |
16 } | |
17 } else if ($_SERVER["REQUEST_METHOD"] == "GET") { | |
18 if (isset($_SERVER["HTTP_X_CUSTOM_S"])) | |
19 echo "PASS"; | |
20 else | |
21 echo "FAIL"; | |
22 } | |
23 ?> | |
OLD | NEW |