Merge pull request #22497 from owncloud/fix-redirect-response
set correct http status code in redirect response
This commit is contained in:
commit
99d6a6b230
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue