Skip to content
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

"-O -J" cannot get the correct file name in some URLs #6880

Closed
gek64 opened this issue Apr 10, 2021 · 3 comments
Closed

"-O -J" cannot get the correct file name in some URLs #6880

gek64 opened this issue Apr 10, 2021 · 3 comments
Labels

Comments

@gek64
Copy link

gek64 commented Apr 10, 2021

I did this

curl -O -J -L "https://download.mozilla.org/?product=firefox-esr-latest-ssl&os=win64&lang=en-US"

I expected the following

# the correct file name should be
Firefox Setup 78.9.0esr.exe
# but the result is
_product=firefox-esr-latest-ssl&os=win64&lang=en-US

curl/libcurl version

# windows
curl 7.76.0 (x86_64-pc-win32) libcurl/7.76.0 OpenSSL/1.1.1k (Schannel) zlib/1.2.11 brotli/1.0.9 zstd/1.4.9 WinIDN libssh2/1.9.0 nghttp2/1.43.0 libgsasl/1.10.0
Release-Date: 2021-03-31
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS brotli gsasl HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz MultiSSL NTLM SPNEGO SSL SSPI TLS-SRP Unicode UnixSockets zstd

# linux
curl 7.68.0 (x86_64-pc-linux-gnu) libcurl/7.68.0 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh/0.9.3/openssl/zlib nghttp2/1.40.0 librtmp/2.3
Release-Date: 2020-01-08
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS brotli GSS-API HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets

operating system

# Windows 10 20H2
# Ubuntu 20.04
- Linux ubuntu 5.4.0-70-generic #78-Ubuntu SMP Fri Mar 19 13:29:52 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
@bagder
Copy link
Member

bagder commented Apr 10, 2021

mentioned in the todo document.

--O is clearly documented to not cover this case and -J looks for a header that wasn't set.

@gek64
Copy link
Author

gek64 commented Apr 10, 2021

thank you

@gek64 gek64 closed this as completed Apr 10, 2021
@mnalis
Copy link

mnalis commented Sep 2, 2023

It would be nice if this was implemented as an curl option, as one currently has to stick with wget --trust-server-names

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants