mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-18 17:26:28 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ee5c2207f8 | |||
| c4fcf750d4 | |||
| a92b6008fa | |||
| b1ca3fc9ef |
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user