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
HttpMethodValidator produces 404 instead of 405 response #24018
Comments
Hi @schmengler. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
For more details, please, review the Magento Contributor Assistant documentation. @schmengler do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?
|
Hi @engcom-Bravo. Thank you for working on this issue.
|
@engcom-Bravo Thank you for verifying the issue. Unfortunately, not enough information was provided to acknowledge ticket. Please consider adding the following:
Once all required information is added, please add label |
✅ Confirmed by @engcom-Bravo Issue Available: @engcom-Bravo, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself. |
Hi @anujwebkul. Thank you for working on this issue.
|
@magento i am working on it. |
Hi @vishesh-webkul. Thank you for working on this issue.
|
Just wanted to link the original discussion here magento/architecture#10 (comment) (the decision was to have 404). |
Summary
The validation based on the new (2.3.0+) HTTP method marker interfaces (HttpGetActionInterface, HttpPostActionInterface, ...) throw an exception that is turned into a 404 response by the front controller:
A proper response status code would be
405 Method Not Allowed
.Steps to reproduce
HttpPostActionInterface
Expected Result
Actual Result
Proposed solution
NotFoundException
that at least returns an error page with the correct status code. Minimum solution: send correct status codeJsonActionInterface
,HtmlActionInterface
, ... and return a different body depending on those Ideal solution: enable handling of 405 errors in different contextThe text was updated successfully, but these errors were encountered: