-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
tool_operate: for -O, use a default filename when the URL has none #13988
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
Conversation
0e32c92
to
cc1100e
Compare
Alternatively, we could consider picking the filename from the last directory part in the URL or similar, but that is harder to explain (also: there is not always a directory). It cannot use the content-type or similar since it needs to be 100% deterministic based on the given URL. Note: |
35c32cd
to
7314ddb
Compare
If it were up to me, I would prefer a filename other than |
Yeah,
|
As a point of reference, wget uses the name |
It was suggested that we should effectively enable I'm not sure that's a good idea even if I like the thinking. |
ce57eb8
to
41b28dd
Compare
Having
This also means that if curl were to have I believe users overall would still prefer I don't really know which one is best, I'm commenting just to expose how I see the issue and hopefully help. |
... or pick the last directory part from the path if available. Instead of returning error. Add test 690 to verify. Test 76 and 2036: no longer apply.
... or pick the last directory part from the path if available. Instead of returning error. Add test 690 to verify. Test 76 and 2036: no longer apply. Closes #13988
41b28dd
to
f068333
Compare
Could translate back from response
to file type suffix extension using
The code could be something equivalent to this
Added similar comment to @wCurl curl/wcurl#4 |
I avoided that because of all the potential issues with IDN etc |
Using the host name the user entered/provided should be no issue, whereas the IDN 2003/2008 encoded name is NOT User Friendly(TM)!
|
Amusingly, when I try your
|
What if the user provides an IDN name? In Swedish doing
Then something is funny.
Then something is wrong. |
Sorry, by IDN I thought you meant the encoded ASCII name |
Thanks Daniel, |
curl sets the filename to the last directory part of the URL or if that also is missing to
default
(without extension) for this situation.Instead of returning error.
Add test 690 and 691 to verify