[Win] PHP scripts fail if HTTP_ORIGIN is not set.
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Apr 2015 17:05:30 +0000 (17:05 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Apr 2015 17:05:30 +0000 (17:05 +0000)
https://bugs.webkit.org/show_bug.cgi?id=144333

Rubberstamped by Brady Eidson.

* http/tests/security/resources/cors-post-redirect-target.php: Check
that HTTP_ORIGIN key exists before using it to avoid PHP error.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183483 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/http/tests/security/resources/cors-post-redirect-target.php

index 9bb9434..0e9cdd8 100644 (file)
@@ -1,3 +1,13 @@
+2015-04-28  Brent Fulgham  <bfulgham@apple.com>
+
+        [Win] PHP scripts fail if HTTP_ORIGIN is not set.
+        https://bugs.webkit.org/show_bug.cgi?id=144333
+
+        Rubberstamped by Brady Eidson.
+
+        * http/tests/security/resources/cors-post-redirect-target.php: Check
+        that HTTP_ORIGIN key exists before using it to avoid PHP error.
+
 2015-04-28  Andy Estes  <aestes@apple.com>
 
         Add expectations for tests added in r183428 and r183450.
index 346c185..2c5e8a7 100644 (file)
@@ -2,7 +2,7 @@
 header("Cache-Control: no-store");
 
 $sawOrigin = false;
-$originHeader = $_SERVER['HTTP_ORIGIN'];
+$originHeader = isset($_SERVER['HTTP_ORIGIN']) ? $_SERVER['HTTP_ORIGIN'] : null;
 if ($originHeader) {
     echo "Origin header value: $originHeader";
     $sawOrigin = true;