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

--remote-name doesn't honor the filename after redirect with --location #1241

Closed
nodakai opened this Issue Feb 3, 2017 · 1 comment

Comments

Projects
None yet
3 participants
@nodakai

nodakai commented Feb 3, 2017

I did this

$ curl -LOJ -v https://www.archlinux.org/packages/community/x86_64/shellcheck/download/
...
< Location: http://mirrors.cicku.me/archlinux/community/os/x86_64/shellcheck-0.4.5-1-x86_64.pkg.tar.xz
...
Warning: Remote filename has no length!
* Failed writing body (0 != 2675)
  0 1772k    0  2675    0     0   2008      0  0:15:03  0:00:01  0:15:02  2008
* Closing connection 1
curl: (23) Failed writing body (0 != 2675)

I expected the following

Successfully download shellcheck-0.4.5-1-x86_64.pkg.tar.xz

curl/libcurl version

$ curl -V
curl 7.48.0-DEV (x86_64-unknown-linux-gnu) libcurl/7.48.0-DEV OpenSSL/1.0.1e zlib/1.2.3 libidn/1.18

operating system

$ uname -r
2.6.32-504.16.2.el6.x86_64
$ cat /etc/system-release
CentOS release 6.6 (Final)

@bagder

This comment has been minimized.

Member

bagder commented Feb 3, 2017

This works as designed in order to not cause surprises if the site would redirect the URL to a file name that you might already use in your current directory. The man page explains this:

The remote file name to use for saving is extracted from the given URL, nothing else

We could possibly consider -J to ask for this to be handled as you suggest, but it isn't currently and I think I consider that more of a missing feature than an actual bug or problem.

@jay jay added the enhancement label Feb 3, 2017

@bagder bagder closed this in c2127b4 Feb 15, 2017

@lock lock bot locked as resolved and limited conversation to collaborators May 6, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.