Merge pull request #22497 from owncloud/fix-redirect-response

set correct http status code in redirect response
This commit is contained in:
Thomas Müller 2016-02-18 14:24:12 +01:00
commit 99d6a6b230
2 changed files with 2 additions and 2 deletions

View File

@ -44,7 +44,7 @@ class RedirectResponse extends Response {
*/ */
public function __construct($redirectURL) { public function __construct($redirectURL) {
$this->redirectURL = $redirectURL; $this->redirectURL = $redirectURL;
$this->setStatus(Http::STATUS_TEMPORARY_REDIRECT); $this->setStatus(Http::STATUS_SEE_OTHER);
$this->addHeader('Location', $redirectURL); $this->addHeader('Location', $redirectURL);
} }

View File

@ -43,7 +43,7 @@ class RedirectResponseTest extends \Test\TestCase {
public function testHeaders() { public function testHeaders() {
$headers = $this->response->getHeaders(); $headers = $this->response->getHeaders();
$this->assertEquals('/url', $headers['Location']); $this->assertEquals('/url', $headers['Location']);
$this->assertEquals(Http::STATUS_TEMPORARY_REDIRECT, $this->assertEquals(Http::STATUS_SEE_OTHER,
$this->response->getStatus()); $this->response->getStatus());
} }