Commit fb0f1583 authored by Sonia Zorba's avatar Sonia Zorba
Browse files

Handled detection of http/https protocol also behind proxy

parent d1da5794
Loading
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -27,7 +27,8 @@ class Locator {
    }

    public function getProtocol(): string {
        return (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') ? 'https://' : 'http://';
        return (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') ? 'https://' : (
                isset($_SERVER['HTTP_X_FORWARDED_PROTO']) ? $_SERVER['HTTP_X_FORWARDED_PROTO'] . '://' : 'http://');
    }

    public function getBasePath(): string {