laravel / lumen-framework

The Laravel Lumen Framework.
https://lumen.laravel.com
MIT License
1.48k stars 420 forks source link

Respect status code of AuthorizationException #1260

Closed rolandboon closed 1 year ago

rolandboon commented 1 year ago

The AuthorizationException handled here can have an optionally set status code. By default this status is null, so the previous code to map this to 403 seems correct. But if I throw a (new AuthorizationException())->withStatus(401) I would expect the exception handler to respect this code.