This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #20871).
[HttpKernel] Give higher priority to adding request formats
| Q | A
| ------------- | ---
| Branch? | 3.2
| Bug fix? | yes
| New feature? | yes
| BC breaks? | yes (unlikely to break projects*)
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | none
| License | MIT
| Doc PR | not documented
\* Only applies to the unlikely case where formats are used before this event is loaded key. Users must have specified custom formats, and actually using them should then break their application. I think that's an unlikely case.
It's possible to extend the formats known by the `Request` using a piece of config:
Using this in a `kernel.request` event is currently not possible, as it loads after any custom events.
## Offered solution
Increasing the priority of the AddRequestFormatsListener listener resolves this problem.
This change only impacts projects that use the `framework.request.formats` configuration key, as the listener is not loaded if it isn't defined.
9edb457 [HttpKernel] Give higher priority to adding request formats