You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems to me that we shouldn't change _format into format on the request attribute bag while duplicating a request.
It breaks FOSRestBundle's exception handling by not being able to correctly pass the original request's format into the FormatNegotiation library. Consequently, my json comes out as html for all 403 errors... 👎
The text was updated successfully, but these errors were encountered:
This PR was merged into the 2.2 branch.
Discussion
----------
[HttpKernel] Fix request _format duplication for HttpKernel's ExceptionListener
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #8777, #8778
| License | MIT
This is a better fix for #8777.
Commits
-------
f946108 fixed the format of the request used to render an exception
Found while working with FOSRestBundle's FormatNegotiator.
In
HttpKernel/EventListener/ExceptionListener.php
Whereas the
$request->getRequestFormat()
line retrieves the format from the attribute bag as_format
.In
HttpFoundation/Request.php
It seems to me that we shouldn't change
_format
intoformat
on the request attribute bag while duplicating a request.It breaks FOSRestBundle's exception handling by not being able to correctly pass the original request's format into the FormatNegotiation library. Consequently, my json comes out as html for all 403 errors... 👎
The text was updated successfully, but these errors were encountered: