-
-
Notifications
You must be signed in to change notification settings - Fork 65
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
Malformed request causes 500 response #183
Comments
It's pretty easy to trigger this exception, From what I can tell, RFC 7230 does not prohibit numeric header names. |
Duplicate of #11 |
Not that I am aware of. I don't expect anything to change except some errata may be. This really boils down to a php bug that php wont fix and it can only be mitigated by type casting each and every time array key is read. Not really feasible. |
Internally, headers could be |
Please read original issue comments and look at closed PR attempting to solve it. |
It is impossible to fix or work around: |
Bug Report
Summary
Malformed request causes 500 response when sending integers in header names.
Current behavior
Returns response with http code 500 for requests with invalid headers.
How to reproduce
Send random integer in header name in request.
Expected behavior
Returns response with http code 400 for requests with invalid headers.
If this exception code was set to 400 it would be used as http response code in ServerRequestErrorResponseGenerator.
https://github.com/laminas/laminas-diactoros/blob/2.26.x/src/HeaderSecurity.php#L152-L155
The text was updated successfully, but these errors were encountered: