Merge pull request #13753 from owncloud/use-403-instead-of-200
Use 403 instead of 200 response
This commit is contained in:
commit
485e2a282b
2 changed files with 5 additions and 5 deletions
|
@ -59,7 +59,9 @@ class SubadminMiddleware extends Middleware {
|
|||
* @return TemplateResponse
|
||||
*/
|
||||
public function afterException($controller, $methodName, \Exception $exception) {
|
||||
return new TemplateResponse('core', '403', array(), 'guest');
|
||||
$response = new TemplateResponse('core', '403', array(), 'guest');
|
||||
$response->setStatus(Http::STATUS_FORBIDDEN);
|
||||
return $response;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -81,11 +81,9 @@ class SubadminMiddlewareTest extends \Test\TestCase {
|
|||
$this->subadminMiddlewareAsSubAdmin->beforeController($this->controller, 'foo');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function testAfterException() {
|
||||
$expectedResponse = new TemplateResponse('core', '403', array(), 'guest');
|
||||
$expectedResponse->setStatus(403);
|
||||
$this->assertEquals($expectedResponse, $this->subadminMiddleware->afterException($this->controller, 'foo', new \Exception()));
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue