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

Side by Side Diff: LayoutTests/http/tests/xmlhttprequest/resources/access-control-preflight-request-invalid-status.php

Issue 21532002: CORS: Handle error HTTP status code 4XX/5XX in preflight requests. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 4 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
(Empty)
1 <?php
2 $code = $_GET['code'];
3 $request_origin_value = $_SERVER["HTTP_ORIGIN"];
4 $access_control_request_headers = $_SERVER["HTTP_ACCESS_CONTROL_REQUEST_HEAD ERS"];
5
6 if ($_SERVER['REQUEST_METHOD'] == "OPTIONS") {
7 if ($code == "400") {
8 header("HTTP/1.1 400");
9 }
10 else if ($code == "501"){
11 header("HTTP/1.1 501");
12 }
13 header("Access-Control-Allow-Methods: GET");
14 header("Access-Control-Max-Age: 1");
15 } else {
16 header("HTTP/1.1 200");
17 }
18 if (!is_null($request_origin_value)) {
19 header("Access-Control-Allow-Origin: $request_origin_value");
20 }
21 if (!is_null($access_control_request_headers))
22 header("Access-Control-Allow-Headers: $access_control_request_headers");
23 ?>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698