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

Side by Side Diff: LayoutTests/http/tests/serviceworker/resources/fetch-access-control.php

Issue 399543002: [ServiceWorker] Make fetch() method better conformance with the spec. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: incorporated yhirano's comment Created 6 years, 5 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 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);
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 ?>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698