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

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

Issue 533123002: [ServiceWorker] Send the body of Request in fetch() API. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: move tests to fetch-worker.js Created 6 years, 3 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
« no previous file with comments | « no previous file | LayoutTests/http/tests/serviceworker/resources/fetch-worker.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <?php 1 <?php
2 header('X-ServiceWorker-ServerHeader: SetInTheServer'); 2 header('X-ServiceWorker-ServerHeader: SetInTheServer');
3 if (isset($_GET['ACAOrigin'])) { 3 if (isset($_GET['ACAOrigin'])) {
4 $origins = explode(',', $_GET['ACAOrigin']); 4 $origins = explode(',', $_GET['ACAOrigin']);
5 for ($i = 0; $i < sizeof($origins); ++$i) 5 for ($i = 0; $i < sizeof($origins); ++$i)
6 header("Access-Control-Allow-Origin: " . $origins[$i], false); 6 header("Access-Control-Allow-Origin: " . $origins[$i], false);
7 } 7 }
8 8
9 if (isset($_GET['ACAHeaders'])) 9 if (isset($_GET['ACAHeaders']))
10 header("Access-Control-Allow-Headers: {$_GET['ACAHeaders']}"); 10 header("Access-Control-Allow-Headers: {$_GET['ACAHeaders']}");
(...skipping 26 matching lines...) Expand all
37 if (isset($_SERVER['PHP_AUTH_USER'])) { 37 if (isset($_SERVER['PHP_AUTH_USER'])) {
38 $username = $_SERVER['PHP_AUTH_USER']; 38 $username = $_SERVER['PHP_AUTH_USER'];
39 } 39 }
40 if (isset($_SERVER['PHP_AUTH_PW'])) { 40 if (isset($_SERVER['PHP_AUTH_PW'])) {
41 $password = $_SERVER['PHP_AUTH_PW']; 41 $password = $_SERVER['PHP_AUTH_PW'];
42 } 42 }
43 if (isset($_COOKIE['cookie'])) { 43 if (isset($_COOKIE['cookie'])) {
44 $cookie = $_COOKIE['cookie']; 44 $cookie = $_COOKIE['cookie'];
45 } 45 }
46 46
47 $files = array();
48 foreach ($_FILES as $key => $file) {
49 $content = '';
50 $fp = fopen($file['tmp_name'], 'r');
51 if ($fp) {
52 $content = $file['size'] > 0 ? fread($fp, $file['size']) : '';
53 fclose($fp);
54 }
55 $files[] = array('key' => $key,
56 'name' => $file['name'],
57 'type' => $file['type'],
58 'error' => $file['error'],
59 'size' => $file['size'],
60 'content' => $content);
61 }
62
47 header('Content-Type: application/json'); 63 header('Content-Type: application/json');
48 $arr = array('jsonpResult' => 'success', 64 $arr = array('jsonpResult' => 'success',
49 'method' => $_SERVER['REQUEST_METHOD'], 65 'method' => $_SERVER['REQUEST_METHOD'],
50 'headers' => getallheaders(), 66 'headers' => getallheaders(),
67 'body' => file_get_contents('php://input'),
68 'files' => $files,
69 'get' => $_GET,
70 'post' => $_POST,
51 'username' => $username, 71 'username' => $username,
52 'password' => $password, 72 'password' => $password,
53 'cookie' => $cookie); 73 'cookie' => $cookie);
54 $json = json_encode($arr); 74 $json = json_encode($arr);
55 echo "report( $json );"; 75 echo "report( $json );";
56 ?> 76 ?>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/http/tests/serviceworker/resources/fetch-worker.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698