route : Add proxy support
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3989 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
@@ -97,7 +97,10 @@ class route
|
||||
$this->baseURL = dirname ($_SERVER["SCRIPT_NAME"]);
|
||||
if (isset ($_SERVER["SERVER_NAME"]))
|
||||
$this->baseURL = "//".$_SERVER["SERVER_NAME"].$port.$this->baseURL;
|
||||
if (isset ($_SERVER["HTTPS"]))
|
||||
if (isset ($_SERVER["HTTPS"]) ||
|
||||
(isset ($_SERVER["HTTP_X_FORWARDED_PROTO"]) &&
|
||||
$_SERVER["HTTP_X_FORWARDED_PROTO"] === "https")
|
||||
)
|
||||
$this->baseURL = "https:".$this->baseURL;
|
||||
else
|
||||
$this->baseURL = "http:".$this->baseURL;
|
||||
@@ -174,7 +177,9 @@ class route
|
||||
$url = "";
|
||||
if ($absolute === true)
|
||||
{
|
||||
if (isset ($_SERVER["HTTPS"]))
|
||||
if (isset ($_SERVER["HTTPS"]) ||
|
||||
isset ($_SERVER["HTTP_X_FORWARDED_PROTO"]) &&
|
||||
$_SERVER["HTTP_X_FORWARDED_PROTO"] === "https")
|
||||
$url = "https:";
|
||||
else
|
||||
$url = "http:";
|
||||
|
||||
Reference in New Issue
Block a user