8000 Respect status code of AuthorizationException (#1260) · laravel/lumen-framework@d1145bd · GitHub
[go: up one dir, main page]

Skip to content

Commit d1145bd

Browse files
authored
Respect status code of AuthorizationException (#1260)
1 parent 4fc13f8 commit d1145bd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Exceptions/Handler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public function render($request, Throwable $e)
111111
} elseif ($e instanceof ModelNotFoundException) {
112112
$e = new NotFoundHttpException($e->getMessage(), $e);
113113
} elseif ($e instanceof AuthorizationException) {
114-
$e = new HttpException(403, $e->getMessage());
114+
$e = new HttpException($e->status() ?? 403, $e->getMessage());
115115
} elseif ($e instanceof ValidationException && $e->getResponse()) {
116116
return $e->getResponse();
117117
}

0 commit comments

Comments
 (0)
0