summaryrefslogtreecommitdiff
path: root/engine/RedirectResponse.php
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2022-07-09 20:23:29 +0300
committerEvgeny Zinoviev <me@ch1p.io>2022-07-09 20:23:29 +0300
commit34b7980587df61ae084bddd4513a45f6218467cd (patch)
tree66bfa1000fba991d5ebcef32628144b2499879ef /engine/RedirectResponse.php
parent8ea3807f4bdfd1c538b965fa3dfc5f1e5a9a9854 (diff)
use 302 redirects by default, explicitely specify 301 where really needed
Diffstat (limited to 'engine/RedirectResponse.php')
-rw-r--r--engine/RedirectResponse.php5
1 files changed, 2 insertions, 3 deletions
diff --git a/engine/RedirectResponse.php b/engine/RedirectResponse.php
index 7900229..4526c6c 100644
--- a/engine/RedirectResponse.php
+++ b/engine/RedirectResponse.php
@@ -2,9 +2,8 @@
class RedirectResponse extends Response {
- public function __construct(string $url) {
- parent::__construct(301);
- $this->addHeader('HTTP/1.1 301 Moved Permanently');
+ public function __construct(string $url, int $code = 302) {
+ parent::__construct($code);
$this->addHeader('Location: '.$url);
}