Bug 144333 - [Win] PHP scripts fail if HTTP_ORIGIN is not set
Summary: [Win] PHP scripts fail if HTTP_ORIGIN is not set
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P2 Normal
Assignee: Brent Fulgham
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-28 09:23 PDT by Brent Fulgham
Modified: 2015-04-28 10:07 PDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brent Fulgham 2015-04-28 09:23:13 PDT
For some reason, the Windows port does not populate the HTTP_ORIGIN header value:

"Notice: Undefined index: HTTP_ORIGIN in C:\Projects\WebKit\OpenSource\LayoutTests\http\tests\security\resources\cors-post-redirect-target.php on line 5
There was no origin header"

However, we appear to make all the same calls to 'setOrigin' as the Mac port, which does provide this field in the HTTP header.

This discrepancy is causing these tests to fail (and perhaps others):

http/tests/security/cors-post-redirect-301.html
http/tests/security/cors-post-redirect-302.html
http/tests/security/cors-post-redirect-303.html
http/tests/security/cors-post-redirect-307.html
http/tests/security/cors-post-redirect-308.html
Comment 1 Brent Fulgham 2015-04-28 09:59:17 PDT
My initial understanding of this problem was wrong.

Tests are failing because of a difference in Windows PHP versus its behavior on the Mac:
(a) Mac treats a missing HTTP_ORIGIN 'key' in the HTTP header as a null value.
(b) Win treats a missing HTTP_ORIGIN 'key' in the HTTP header as a failure and terminates the script.

The fix is to check if the key is set before proceeding, which works properly on Windows and Mac.

I will do a quick search of other PHP files to see if this is the cause of other Windows failures.
Comment 2 Brent Fulgham 2015-04-28 10:03:39 PDT
It doesn't appear that there are any other PHP tests suffering from this problem.
Comment 3 Brent Fulgham 2015-04-28 10:06:41 PDT
Committed r183483: <http://trac.webkit.org/changeset/183483>