Added support for x-forwarded-proto http header

This commit is contained in:
Simon Sessingø
2016-03-14 01:09:35 +01:00
parent a92b6008fa
commit c4fcf750d4
2 changed files with 4 additions and 1 deletions
+3
View File
@@ -44,6 +44,9 @@ class Request {
}
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);
}