From 534071f4b23f8e25a236543e78f82b5eb836faed Mon Sep 17 00:00:00 2001 From: v1r0x Date: Thu, 18 Feb 2016 11:56:09 +0100 Subject: [PATCH 1/2] set correct http status code Was intended to respond with a 303 (See other) status code instead of 307 (Temporary Redirect). --- lib/public/appframework/http/redirectresponse.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/public/appframework/http/redirectresponse.php b/lib/public/appframework/http/redirectresponse.php index 7208012295..bb0c884371 100644 --- a/lib/public/appframework/http/redirectresponse.php +++ b/lib/public/appframework/http/redirectresponse.php @@ -44,7 +44,7 @@ class RedirectResponse extends Response { */ public function __construct($redirectURL) { $this->redirectURL = $redirectURL; - $this->setStatus(Http::STATUS_TEMPORARY_REDIRECT); + $this->setStatus(Http::STATUS_SEE_OTHER); $this->addHeader('Location', $redirectURL); } From ec6e8c1ab666eb94798ff88da9a8d8ed5e311635 Mon Sep 17 00:00:00 2001 From: v1r0x Date: Thu, 18 Feb 2016 12:39:19 +0100 Subject: [PATCH 2/2] fix unit test --- tests/lib/appframework/http/RedirectResponseTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/lib/appframework/http/RedirectResponseTest.php b/tests/lib/appframework/http/RedirectResponseTest.php index 17db0c0be6..723f6600c5 100644 --- a/tests/lib/appframework/http/RedirectResponseTest.php +++ b/tests/lib/appframework/http/RedirectResponseTest.php @@ -43,7 +43,7 @@ class RedirectResponseTest extends \Test\TestCase { public function testHeaders() { $headers = $this->response->getHeaders(); $this->assertEquals('/url', $headers['Location']); - $this->assertEquals(Http::STATUS_TEMPORARY_REDIRECT, + $this->assertEquals(Http::STATUS_SEE_OTHER, $this->response->getStatus()); }