-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
Http client parses request body with parse_str and runs into input variables exceeded limit. #36976
Comments
I tried to pass a resource, since PHPDOC clearly stated that the withBody method accepts either resource or string.
But this dies with a different error somewhere really deep:
This probably deserves a different ticket. |
Are you able to send a PR with a fix? |
Unfortunately not, as I don't fully understand the purpose of parsing the string. I think that the purpose of it is to handle cases when it's a regular form body in the Edit: One moment, trying to make a PR. |
It appears that my PR also solves the issue with a resource/stream as the body, added a test for that case too. |
Description:
\Illuminate\Http\Client\PendingRequest::parseRequestData
method usesparse_str
if laravelData variable is a string, even if the contents are not a query string. This method is restricted by PHP ini settingmax_input_vars
. With some payloads (XML, e.g.) this can be easily exceeded by accident.Steps To Reproduce:
Generate a valid XML with "looks-like-query-params" contents.
This code will trigger an exception:
parse_str(): Input variables exceeded 1000. To increase the limit change max_input_vars in php.ini.
The text was updated successfully, but these errors were encountered: