-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
fetchurl: Allow passing curl options with spaces #164662
Conversation
this looks correct. currently there seems to be only one derivation using a curlOpts list (factorio), and that shouldn't see changed behaviour. a number of others seems to use quotes incorrectly, like xlockmore:
|
a203845
to
5ae5970
Compare
Turns out it wasn't entirely backwards compatible before. But now it is, but I had to introduce a separate
|
factorio no longer evaluates cleanly because it's the only derivation in nixpkgs that passes a list. wondering whether that's enough to infer that lists are also rare outside of nixpkgs and keep the original version, the interface in that one was somewhat nicer than having two parameters for the same function but different semantics for the space character of all things 😕 |
@pennae It's only a warning, but I fixed it now. I don't think it's a problem since it's not an error. Regarding having two parameters, I'm thinking that we could reunify these in the future, once nobody uses the list semantics of |
42449ea
to
ca660e4
Compare
It's impossible to pass arguments with spaces with curlOpts. curlOptsList supports that. Passing a list to curlOpts has been deprecated. This commit is fully backwards compatible.
ca660e4
to
b404704
Compare
I did some minor improvements to the error message, it now looks like
I'll merge this PR soon if there are no complaints :) |
Could you add a test using |
Is there anything blocking this PR 🤔 ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there anything blocking this PR thinking ?
It does not have any tests. See earlier comment.
@roberth @thiagokokada I added a test now for the new functionality |
Description of changes
It previously was impossible to pass arguments with spaces with
curlOpts
. This commit makes it possible withThis is fully backwards compatible, because the behavior of
curlOpts
is maintained, though it now throws a warning if a list is passed to it.Fixes #41820 and #90034
Things done
Tested with
which sets the
Hello
header using-H
, andcurl
s some API that returns the sent HTTP headers as a JSON response, then prints theHello
header that was sentIf you were to use
curlOpts
for this instead, this would be the error and behavior: