Home » HTTP » HTTP » Bug #3378
absoluteURI always applies https protocol under IIS6
Details
| Submitted | 2005-02-04 14:25 UTC |
|---|---|
| From | pjswaine at alphazero dot freeserve dot co dot uk |
| Assigned | mike |
| Status | Closed |
| Package | HTTP |
| PHP Version | 4.3.1 |
| OS | Windows NT |
| Roadmaps | (Not assigned) |
Comments
[2005-02-04 14:25 UTC] pjswaine at alphazero dot freeserve dot co dot uk
Description:
------------
On IIS6 absoluteURI() always returns a URI with the https protocol when a relative address is fed in.
The problem stems from the environmental setting $_SERVER['HTTPS'] which behaves differently under IIS than under Apache. On Apache $_SERVER['HTTPS'] is not set when the protocol is http, but IIS does set it - to "off".
Hence line 288 in version 1.3.3 only checks to see if $_SERVER['HTTPS'] is set, not whether it is set to "on".
Reproduce code:
---------------
Line 288 of HTTP.php v1.3.3 reads:
$protocol = isset($_SERVER['HTTPS']) ? 'https' : 'http';
To fix the issue under IIS it could read:
$protocol = (isset($_SERVER['HTTPS']) AND strtolower($_SERVER['HTTPS']) === "on") ? 'https' : 'http';