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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/http/tests/serviceworker/resources/fetch-worker.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
index 4ca1aaaa538b74cf3094334c40c61c4fc6e644bd..f68a3f665c9ff757de1db3bf7f5a199bfc0cf7d5 100644
--- a/LayoutTests/http/tests/serviceworker/resources/fetch-access-control.php
+++ b/LayoutTests/http/tests/serviceworker/resources/fetch-access-control.php
@@ -44,10 +44,30 @@ if (isset($_COOKIE['cookie'])) {
$cookie = $_COOKIE['cookie'];
}
+$files = array();
+foreach ($_FILES as $key => $file) {
+ $content = '';
+ $fp = fopen($file['tmp_name'], 'r');
+ if ($fp) {
+ $content = $file['size'] > 0 ? fread($fp, $file['size']) : '';
+ fclose($fp);
+ }
+ $files[] = array('key' => $key,
+ 'name' => $file['name'],
+ 'type' => $file['type'],
+ 'error' => $file['error'],
+ 'size' => $file['size'],
+ 'content' => $content);
+}
+
header('Content-Type: application/json');
$arr = array('jsonpResult' => 'success',
'method' => $_SERVER['REQUEST_METHOD'],
'headers' => getallheaders(),
+ 'body' => file_get_contents('php://input'),
+ 'files' => $files,
+ 'get' => $_GET,
+ 'post' => $_POST,
'username' => $username,
'password' => $password,
'cookie' => $cookie);
« 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