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

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

Issue 875363002: Sort header names in Access-Control-Request-Headers (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: tyoshino's comments Created 5 years, 10 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 if ($_SERVER["REQUEST_METHOD"] == "OPTIONS") {
3 // Check that the names in Access-Control-Request-Headers are
4 // "sorted lexicographically, and byte lowercased".
5 // Fetch API Spec: https://fetch.spec.whatwg.org/#cors-preflight-fetch-0
6 if ($_SERVER["HTTP_ACCESS_CONTROL_REQUEST_HEADERS"] ==
7 'x-custom-s, x-custom-test, x-custom-u, x-custom-ua, x-custom-v') {
8 header("Access-Control-Allow-Headers: x-custom-s, x-custom-test, x-custo m-u, x-custom-ua, x-custom-v");
9 } else {
10 header("HTTP/1.1 400");
11 }
12 header("Access-Control-Allow-Origin: *");
13 header("Access-Control-Max-Age: 0");
14 } else if ($_SERVER["REQUEST_METHOD"] == "GET") {
15 header("Access-Control-Allow-Origin: *");
16 header("Access-Control-Max-Age: 0");
17 if (isset($_SERVER["HTTP_X_CUSTOM_S"]))
18 echo "PASS";
19 else
20 echo "FAIL";
21 }
22 ?>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698