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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/navigation/resources/save-beacon.php

Issue 2570473002: Enable the CORS preflight for sendBeacon()
Patch Set: Created 4 years 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
Index: third_party/WebKit/LayoutTests/http/tests/navigation/resources/save-beacon.php
diff --git a/third_party/WebKit/LayoutTests/http/tests/navigation/resources/save-beacon.php b/third_party/WebKit/LayoutTests/http/tests/navigation/resources/save-beacon.php
index 1888c9329cc5bdbd380cf21a39a513310e89488e..e564a7e8d044b684b2fa29efc0666e229fa26aa7 100644
--- a/third_party/WebKit/LayoutTests/http/tests/navigation/resources/save-beacon.php
+++ b/third_party/WebKit/LayoutTests/http/tests/navigation/resources/save-beacon.php
@@ -1,6 +1,14 @@
<?php
require_once '../../resources/portabilityLayer.php';
+if ($_SERVER["REQUEST_METHOD"] == "OPTIONS") {
+ header("Access-Control-Allow-Origin: http://127.0.0.1:8000");
+ header("Access-Control-Allow-Credentials: true");
+ header("Access-Control-Allow-Method: post");
+ header("Access-Control-Allow-Headers: content-type,cache-control");
+ exit();
+}
+
function prettify($name) {
return str_replace(' ', '-', ucwords(str_replace('_', ' ', str_replace('http_', '', strtolower($name)))));
}

Powered by Google App Engine
This is Rietveld 408576698