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

unexpected bad/illegal url format error. A short host + port is treated as a scheme! #3220

Closed
hagai-auro opened this Issue Nov 2, 2018 · 3 comments

Comments

Projects
None yet
3 participants
@hagai-auro

hagai-auro commented Nov 2, 2018

The scenario is that I have a hostname boing in /etc/hosts pointing to 127.0.0.1 , and I port-forward to the real host.

I did this

$ curl boing:80
curl: (3) URL using bad/illegal format or missing URL

and if I did:
$ curl http://boing:80
it worked

I expected the following

I expected it to actually issue the request, but to illustrate the change from a previous version, if I hadn't defined boing in /etc/hosts, I'd get this:
$ curl boing:80
curl: (6) Could not resolve host: boing

curl/libcurl version

$ curl -V
curl 7.62.0 (x86_64-apple-darwin16.7.0) libcurl/7.62.0 OpenSSL/1.0.2p zlib/1.2.8 libidn2/2.0.5 Release-Date: 2018-10-31 Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp Features: AsynchDNS IDN IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP UnixSockets HTTPS-proxy

operating system

$ uname -a
Darwin hagai-mba-osx 16.7.0 Darwin Kernel Version 16.7.0: Thu Jun 21 20:07:39 PDT 2018; root:xnu-3789.73.14~1/RELEASE_X86_64 x86_64 i386 MacBookAir6,2 Darwin

@gvanem

This comment has been minimized.

Member

gvanem commented Nov 2, 2018

And curiously a curl boing will try to resolve boing with recursing over a dot less name.

@bagder

This comment has been minimized.

Member

bagder commented Nov 2, 2018

Ack, a regression from 46e1640. PR coming up.

bagder added a commit that referenced this issue Nov 2, 2018

url: a short host name + port is not a scheme
The function identifying a leading "scheme" part of the URL considered a few
letters ending with a colon to be a scheme, making something like "short:80"
to become an unknown scheme instead of a short host name and a port number.

Extended test 1560 to verify.

Reported-by: Hagai Auro
Fixes #3220

bagder added a commit that referenced this issue Nov 2, 2018

url: a short host name + port is not a scheme
The function identifying a leading "scheme" part of the URL considered a few
letters ending with a colon to be a scheme, making something like "short:80"
to become an unknown scheme instead of a short host name and a port number.

Extended test 1560 to verify.

Reported-by: Hagai Auro
Fixes #3220

@bagder bagder closed this in 226cfa8 Nov 3, 2018

bagder added a commit that referenced this issue Nov 5, 2018

url: a short host name + port is not a scheme
The function identifying a leading "scheme" part of the URL considered a few
letters ending with a colon to be a scheme, making something like "short:80"
to become an unknown scheme instead of a short host name and a port number.

Extended test 1560 to verify.

Also fix test203 to use posix_pwd to make it get the correct path on windows

Reported-by: Hagai Auro
Fixes #3220
Fixes #3233
Closes #3223
Closes #3235
@bagder

This comment has been minimized.

Member

bagder commented Nov 5, 2018

commit d9abebc reverted the fix temporarily since it broke tests on windows. #3235 should ideally fix it "proper".

@bagder bagder reopened this Nov 5, 2018

@bagder bagder changed the title from unexpected bad/illegal url format error to unexpected bad/illegal url format error. A short host + port is treated as a scheme! Nov 5, 2018

bagder added a commit that referenced this issue Nov 6, 2018

url: a short host name + port is not a scheme
The function identifying a leading "scheme" part of the URL considered a few
letters ending with a colon to be a scheme, making something like "short:80"
to become an unknown scheme instead of a short host name and a port number.

Extended test 1560 to verify.

Also fix test203 to use posix_pwd to make it get the correct path on windows

Reported-by: Hagai Auro
Fixes #3220
Fixes #3233
Closes #3223
Closes #3235

@bagder bagder closed this in 9df8dc1 Nov 6, 2018

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