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

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 falken'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 $username = 'undefined';
26 $password = 'undefined';
27 if (isset($_SERVER['PHP_AUTH_USER'])) {
28 $username = $_SERVER['PHP_AUTH_USER'];
29 }
30 if (isset($_SERVER['PHP_AUTH_PW'])) {
31 $password = $_SERVER['PHP_AUTH_PW'];
32 }
33
34 header('Content-Type: application/json');
35 $arr = array('jsonpResult' => 'success',
36 'method' => $_SERVER['REQUEST_METHOD'],
37 'headers' => getallheaders(),
38 'username' => $username,
39 'password' => $password);
40 $json = json_encode($arr);
41 echo "report( $json );";
42 ?>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698