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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/redirect.php

Issue 2421093003: Allow redirects for requests that require preflight. (Closed)
Patch Set: Rebase on custom headers CL Created 4 years, 1 month 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
1 <?php 1 <?php
2 if (isset($_GET['Status'])) { 2 if ($_SERVER['REQUEST_METHOD'] !== 'OPTIONS') {
yhirano 2016/11/22 04:05:23 Sorry, I don't understand the intention of this ch
Jack Bates 2016/11/22 18:24:17 Without this, it sends a redirect response to the
3 header ("HTTP/1.1 " . $_GET["Status"]); 3 $url = $_GET['Redirect'];
4 } else { 4 if ($url != "noLocation") {
5 header ("HTTP/1.1 302"); 5 header("Location: $url");
6 } 6 }
7 $url = $_GET['Redirect']; 7 if (isset($_GET['Status'])) {
8 if ($url != "noLocation") { 8 header ("HTTP/1.1 " . $_GET["Status"]);
9 header("Location: $url"); 9 } else {
10 header ("HTTP/1.1 302");
11 }
10 } 12 }
11 if (isset($_GET['ACAOrigin'])) { 13 if (isset($_GET['ACAOrigin'])) {
12 $origins = explode(',', $_GET['ACAOrigin']); 14 $origins = explode(',', $_GET['ACAOrigin']);
13 for ($i = 0; $i < sizeof($origins); ++$i) 15 for ($i = 0; $i < sizeof($origins); ++$i)
14 header("Access-Control-Allow-Origin: " . $origins[$i], false); 16 header("Access-Control-Allow-Origin: " . $origins[$i], false);
15 } 17 }
16 if (isset($_GET['ACAHeaders'])) 18 if (isset($_GET['ACAHeaders']))
17 header("Access-Control-Allow-Headers: {$_GET['ACAHeaders']}"); 19 header("Access-Control-Allow-Headers: {$_GET['ACAHeaders']}");
18 if (isset($_GET['ACAMethods'])) 20 if (isset($_GET['ACAMethods']))
19 header("Access-Control-Allow-Methods: {$_GET['ACAMethods']}"); 21 header("Access-Control-Allow-Methods: {$_GET['ACAMethods']}");
20 if (isset($_GET['ACACredentials'])) 22 if (isset($_GET['ACACredentials']))
21 header("Access-Control-Allow-Credentials: {$_GET['ACACredentials']}"); 23 header("Access-Control-Allow-Credentials: {$_GET['ACACredentials']}");
22 if (isset($_GET['ACEHeaders'])) 24 if (isset($_GET['ACEHeaders']))
23 header("Access-Control-Expose-Headers: {$_GET['ACEHeaders']}"); 25 header("Access-Control-Expose-Headers: {$_GET['ACEHeaders']}");
24 if (isset($_GET['NoRedirectTest'])) { 26 if (isset($_GET['NoRedirectTest'])) {
25 echo "report({jsonpResult:'noredirect'});"; 27 echo "report({jsonpResult:'noredirect'});";
26 } 28 }
27 ?> 29 ?>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698