We want to report a bug to symfony/symfony repository regarding ErrorListener
& error_controller
usage resulting in having the wrong request method.
When we use symfony/symfony
and configure the error_controller
in the config/packages/framework.yaml
file, when we get the request_method
, there is an specific case where the request_method
it's always GET
.
This repository is used to reproduce the bug.
- Clone the repository
- Run
composer install
- Run the tests with
./vendor/bin/phpunit
- Create a new symfony project
- Configure the
ErrorListener
anderror_controller
in theconfig/packages/framework.yaml
file - Create a new controller with a POST endpoint that throws a BadRequestHttpException
- Make a POST request to the endpoint
- Check the
request_method
in theerror_controller
- The
request_method
is set toGET
when it should bePOST
in$request->getMethod()
The request_method
should be set to POST