| Index: LayoutTests/http/tests/serviceworker/resources/fetch-access-control.php
|
| diff --git a/LayoutTests/http/tests/serviceworker/resources/fetch-access-control.php b/LayoutTests/http/tests/serviceworker/resources/fetch-access-control.php
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..9b5a2275b822b7d3b6047b975b5380fcf41606e3
|
| --- /dev/null
|
| +++ b/LayoutTests/http/tests/serviceworker/resources/fetch-access-control.php
|
| @@ -0,0 +1,41 @@
|
| +<?php
|
| +header('X-ServiceWorker-ServerHeader: SetInTheServer');
|
| +if (isset($_GET['ACAOrigin'])) {
|
| + $origins = explode(',', $_GET['ACAOrigin']);
|
| + for ($i = 0; $i < sizeof($origins); ++$i)
|
| + header("Access-Control-Allow-Origin: " . $origins[$i], false);
|
| +}
|
| +
|
| +if (isset($_GET['ACAHeaders']))
|
| + header("Access-Control-Allow-Headers: {$_GET['ACAHeaders']}");
|
| +if (isset($_GET['ACAMethods']))
|
| + header("Access-Control-Allow-Methods: {$_GET['ACAMethods']}");
|
| +if (isset($_GET['ACACredentials']))
|
| + header("Access-Control-Allow-Credentials: {$_GET['ACACredentials']}");
|
| +if (isset($_GET['ACEHeaders']))
|
| + header("Access-Control-Expose-Headers: {$_GET['ACEHeaders']}");
|
| +
|
| +if ((isset($_GET['Auth']) and !isset($_SERVER['PHP_AUTH_USER'])) || isset($_GET['AuthFail'])) {
|
| + header('WWW-Authenticate: Basic realm="Restricted"');
|
| + header('HTTP/1.0 401 Unauthorized');
|
| + echo 'Authentication canceled';
|
| + exit;
|
| +}
|
| +
|
| +if (isset($_GET['PNGIMAGE'])) {
|
| + header("Content-type: image/png");
|
| + echo base64_decode(
|
| + 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1B' .
|
| + 'AACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAAhSURBVDhPY3wro/KfgQLABKXJBqMG' .
|
| + 'jBoAAqMGDLwBDAwAEsoCTFWunmQAAAAASUVORK5CYII=');
|
| +} else {
|
| + header('Content-Type: application/json');
|
| + $arr = array('jsonpResult' => 'success',
|
| + 'method' => $_SERVER['REQUEST_METHOD'],
|
| + 'headers' => getallheaders(),
|
| + 'username' => $_SERVER['PHP_AUTH_USER'],
|
| + 'password' => $_SERVER['PHP_AUTH_PW']);
|
| + $json = json_encode($arr);
|
| + echo "report( $json );";
|
| +}
|
| +?>
|
|
|