mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-11 19:02:19 +00:00
Added support for x-forwarded-proto http header
This commit is contained in:
@@ -44,6 +44,9 @@ class Request {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function getIsSecure() {
|
public function getIsSecure() {
|
||||||
|
if(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) === 'https') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return isset($_SERVER['HTTPS']) ? true : (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] === 443);
|
return isset($_SERVER['HTTPS']) ? true : (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] === 443);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ class Response {
|
|||||||
if($httpCode !== null) {
|
if($httpCode !== null) {
|
||||||
$this->httpCode($httpCode);
|
$this->httpCode($httpCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->header('Location: ' . $url);
|
$this->header('Location: ' . $url);
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user