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
curl "https://annuaire.118712.fr/ppart/Paris-75/Paris-75005/Coutinho_aida-0633685195_7%200080S00006F80400R70720S" -vL
returned data : < HTTP/1.1 301 Moved Permanently < Date: Tue, 01 Oct 2019 01:07:37 GMT < Server: Apache < Strict-Transport-Security: max-age=3600; includeSubdomains < Access-Control-Allow-Origin: * < Access-Control-Allow-Methods: POST, GET, OPTIONS, DELETE, PUT < Access-Control-Max-Age: 1000 < Access-Control-Allow-Headers: x-requested-with, Content-Type, origin, authorization, accept, client-security-token < Status: 301 Moved Permanently < Location: https://annuaire.118712.fr/ppart/Paris-75/Paris-75005/Coutinho_aida-JFCCFHEAIE_7 0080S00006F80400R70720S < Connection: close < Transfer-Encoding: chunked < Content-Type: text/html; charset=utf-8
On web browsers, the url redirect to https://annuaire.118712.fr/ppart/Paris-75/Paris-75005/Coutinho_aida-JFCCFHEAIE_7 0080S00006F80400R70720S and the space in that url is handled. But on curl the space is not url encoded which cause the website to return : HTTP/1.1 400 Bad Request
curl -V curl 7.66.0 (x86_64-pc-win32) libcurl/7.66.0 OpenSSL/1.1.1d (Schannel) zlib/1.2.11 brotli/1.0.7 WinIDN libssh2/1.9.0 nghttp2/1.39.2 Release-Date: 2019-09-11 Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp Features: AsynchDNS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile MultiSSL NTLM SPNEGO SSL SSPI TLS-SRP brotli libz
windows 10
The text was updated successfully, but these errors were encountered:
I can reproduce this problem when the redirect is to an absolute URL. If it redirects to a relative path curl URL encodes path components with embedded spaces. I'm on it.
Sorry, something went wrong.
redirect: when following redirects to an absolute URL, URL encode it
1b43300
... to make it handle for example (RFC violating) embeded spaces. Reported-by: momala454 on github Fixes #4445
I don't think this is a regression. I think it never worked with spaces in absolute URLs.
It should be noted that spaces are not allowed in URLs per RFC 3986 which is the primary spec defining curl's URL parsing.
c6f250c
bagder
Successfully merging a pull request may close this issue.
I did this
curl "https://annuaire.118712.fr/ppart/Paris-75/Paris-75005/Coutinho_aida-0633685195_7%200080S00006F80400R70720S" -vL
returned data :
< HTTP/1.1 301 Moved Permanently
< Date: Tue, 01 Oct 2019 01:07:37 GMT
< Server: Apache
< Strict-Transport-Security: max-age=3600; includeSubdomains
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Methods: POST, GET, OPTIONS, DELETE, PUT
< Access-Control-Max-Age: 1000
< Access-Control-Allow-Headers: x-requested-with, Content-Type, origin, authorization, accept, client-security-token
< Status: 301 Moved Permanently
< Location: https://annuaire.118712.fr/ppart/Paris-75/Paris-75005/Coutinho_aida-JFCCFHEAIE_7 0080S00006F80400R70720S
< Connection: close
< Transfer-Encoding: chunked
< Content-Type: text/html; charset=utf-8
I expected the following
On web browsers, the url redirect to https://annuaire.118712.fr/ppart/Paris-75/Paris-75005/Coutinho_aida-JFCCFHEAIE_7 0080S00006F80400R70720S and the space in that url is handled. But on curl the space is not url encoded which cause the website to return :
HTTP/1.1 400 Bad Request
curl/libcurl version
curl -V
curl 7.66.0 (x86_64-pc-win32) libcurl/7.66.0 OpenSSL/1.1.1d (Schannel) zlib/1.2.11 brotli/1.0.7 WinIDN libssh2/1.9.0 nghttp2/1.39.2
Release-Date: 2019-09-11
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile MultiSSL NTLM SPNEGO SSL SSPI TLS-SRP brotli libz
operating system
windows 10
The text was updated successfully, but these errors were encountered: