-
Notifications
You must be signed in to change notification settings - Fork 11.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[5.5] Fixed json responses #20313
[5.5] Fixed json responses #20313
Conversation
We would need a description. |
Ha, see slack. I'll copy it over. Give me a min. :P Also, the test I've added shows what this fixes. |
Description added. Was jet lagged af when I PRed this (still am). :D |
I feel like this had to there for a reason and we are probably breaking something by removing it. I would like to find out what that is. /cc @themsaid |
@taylorotwell Maybe you should start on the PR this was added... #18314 |
@lucasmichot any comment on this? |
The other PR didn't provide a real reason? |
I think the original PR was stupid anyway, because it forces everything to json, and doesn't let you opt-out. |
The current code breaks the exception handler returning json responses: https://github.com/laravel/framework/blob/5.4/src/Illuminate/Foundation/Exceptions/Handler.php#L223.
Here are the headers before and after:
Clearly this is wrong. The laravel response class should never be removing content types provided by the user!