tool_operate: for -O, use "default" as filename when the URL has none

... or pick the last directory part from the path if available.

Instead of returning error.

Add test 690 and 691 to verify. Test 76 and 2036 no longer apply.

Closes #13988
This commit is contained in:
Daniel Stenberg 2024-08-03 20:08:27 +02:00
parent cb829f994d
commit e26eefd9ce
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
8 changed files with 165 additions and 85 deletions

View file

@ -35,3 +35,8 @@ There is no URL decoding done on the filename. If it has %20 or other URL
encoded parts of the name, they end up as-is as filename.
You may use this option as many times as the number of URLs you have.
Before curl 8.10.0, curl returned an error if the URL ended with a slash,
which means that there is no filename part in the URL. Starting in 8.10.0,
curl sets the filename to the last directory part of the URL or if that also
is missing to `curl_response` (without extension) for this situation.