-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
Bug: foo[] parameters in URLs cause an error #2044
Comments
I think we should rather let
|
Makes sense! If you'd point me in the right direction in the code base, I might even be able to submit a pull request for this. (No promises, but it's good nonetheless to document "where" and "how" that fix should be rightfully made.) |
We have code present that skips []-uses for an IPv6-address, so I think putting the check for an empty |
Makes sense indeed! I did an attempt (my very first cURL pull request 🎉) in #2046, let's continue the discussion there. |
I did this
$ curl "http://localhost:8000/api/some-resource?PYNO[]=ZA2134&PYNO[]=ZA2323&PYNO[]=100004232&PYNO[]=ZA1213"
(the real list ofPYNO[]
values is much longer, abbreviated example.)I expected the following
To get the result of the URL. 😄
With the
-g
/--globoff
parameter, it works as expected.I know that the behavior we have now has been this way for years, but... I still consider it a bad default personally, since I happen to use URLs with "array parameters" from time to time. It's also something that is easily supported in web frameworks like PHP. Given the "principle of least surprise", I think it would make more sense to invert the flag so that
--globon
is opt-in, for the cases when you want to work with URL sequences and ranges.But maybe I'm the oddball here? I don't know, if people really like it this way, we shouldn't change it. On any occurrence, this would be a candidate for 8.x rather than something that should be done right now because we shouldn't make changes like this on a minor version release to avoid confusing people.
curl/libcurl version
operating system
macOS High Sierra.
The text was updated successfully, but these errors were encountered: