Fix for issue #78

This commit is contained in:
Jesus M. Castagnetto 2013-10-07 10:50:02 -05:00
parent 6acc979655
commit a5f8b05912

View file

@ -302,8 +302,14 @@ class Pico {
*/
private function get_protocol()
{
preg_match("|^HTTP[S]?|is",$_SERVER['SERVER_PROTOCOL'],$m);
return strtolower($m[0]);
// need to check if HTTPS is set and is not 'off' (and ISAPI/IIS
// peculiarity)
if (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] !== 'off')) {
$protocol = 'https';
} else {
$protocol = 'http';
}
return $protocol;
}
/**