Merge pull request #13753 from owncloud/use-403-instead-of-200

Use 403 instead of 200 response
This commit is contained in:
Morris Jobke 2015-02-07 13:25:15 +01:00
commit 485e2a282b
2 changed files with 5 additions and 5 deletions

View file

@ -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;
}
}

View file

@ -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()));
}
}