Compare commits

..

4 Commits

Author SHA1 Message Date
Simon Sessingø ee5c2207f8 Merge pull request #71 from skipperbent/development
Added support for x-forwarded-proto http header
2016-03-14 01:08:25 +01:00
Simon Sessingø c4fcf750d4 Added support for x-forwarded-proto http header 2016-03-14 01:09:35 +01:00
Simon Sessingø a92b6008fa [TASK] Added http code to redirect method. 2016-03-14 01:00:19 +01:00
Simon Sessingø b1ca3fc9ef Merge pull request #70 from skipperbent/development
[FEATURE] Added http code to redirect method.
2016-03-14 00:59:09 +01:00
2 changed files with 9 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);
}
+6 -1
View File
@@ -19,8 +19,13 @@ class Response {
* Redirect the response
*
* @param string $url
* @param int $httpCode
*/
public function redirect($url) {
public function redirect($url, $httpCode = null) {
if($httpCode !== null) {
$this->httpCode($httpCode);
}
$this->header('Location: ' . $url);
die();
}