From 34b7980587df61ae084bddd4513a45f6218467cd Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Sat, 9 Jul 2022 20:23:29 +0300 Subject: use 302 redirects by default, explicitely specify 301 where really needed --- engine/RedirectResponse.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'engine') 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); } -- cgit v1.2.3