Skip to content

Commit

Permalink
Use 404 HTTP status code instead of 200 for custom error pages
Browse files Browse the repository at this point in the history
  • Loading branch information
javiereguiluz committed Jan 16, 2015
1 parent 6f89cf5 commit 9719aee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Controller/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ protected function initialize(Request $request)
$this->config = $this->container->getParameter('easy_admin.config');

if (0 === count($this->config['entities'])) {
return $this->render('@EasyAdmin/error/no_entities.html.twig');
return $this->render('@EasyAdmin/error/no_entities.html.twig', array(), new Response('', 404));
}

if (!in_array($action = $request->get('action', 'list'), $this->allowedActions)) {
return $this->render('@EasyAdmin/error/forbidden_action.html.twig', array(
'action' => $action,
'allowed_actions' => $this->allowedActions,
));
), new Response('', 404));
}

if (null !== $entityName = $request->get('entity')) {
Expand Down

0 comments on commit 9719aee

Please sign in to comment.