Symfony\Component\HttpKernel\EventListener\ErrorListener
& framework.error_controller
usage resulting in having the wrong request method
#58968
Labels
Symfony version(s) affected
7.1.*
Description
When we use
symfony/symfony
and configure theerror_controller
in theconfig/packages/framework.yaml
file, when we get therequest_method
, there is an specific case where therequest_method
it's alwaysGET
.How to reproduce
error_controller
in theconfig/packages/framework.yaml
filerequest_method
in theerror_controller
request_method
is set toGET
when it should bePOST
in$request->getMethod()
Possible Solution
Change method
Symfony\Component\HttpKernel\EventListener::duplicateRequest
lines:to
That is a quick fix, maybe what needs to be done, is make the
$request->duplicate
method more clear, as it seems it's not really duplicating. Or at least not set a hardcodedGET
.Additional Context
Please check this repository where we reproduce the bug and can be seen in the tests:
https://github.com/Leboski/bug_app_symfony_error_listener
The text was updated successfully, but these errors were encountered: