url: reject ASCII control characters and space in host names

Host names like "127.0.0.1 moo" would otherwise be accepted by some
getaddrinfo() implementations.

Updated test 1034 and 1035 accordingly.

Fixes #2073
Closes #2092
This commit is contained in:
Daniel Stenberg 2017-11-17 16:48:37 +01:00
parent 9554c3c6e5
commit fa939220df
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 47 additions and 48 deletions

View file

@ -13,24 +13,17 @@ config file
#
# Server-side
<reply>
<data>
HTTP/1.0 503 Service Unavailable
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake swsclose
Content-Type: text/html
Funny-head: yesyes
</data>
</reply>
#
# Client-side
<client>
<server>
http
none
</server>
<features>
idn
http
</features>
<setenv>
LC_ALL=
@ -54,17 +47,9 @@ url = "http://invalid-utf8-
</client>
#
# Verify data after the test has been "shot"
<verify>
<strip>
^User-Agent:.*
</strip>
<protocol>
GET http://invalid-utf8-â<>.local/page/1034 HTTP/1.1
Host: invalid-utf8-â<>.local
Accept: */*
Proxy-Connection: Keep-Alive
</protocol>
<errorcode>
3
</errorcode>
</verify>
</testcase>

View file

@ -12,24 +12,17 @@ FAILURE
#
# Server-side
<reply>
<data>
HTTP/1.0 503 Service Unavailable
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake swsclose
Content-Type: text/html
Funny-head: yesyes
</data>
</reply>
#
# Client-side
<client>
<server>
http
none
</server>
<features>
idn
http
</features>
<setenv>
LC_ALL=
@ -52,12 +45,8 @@ http://too-long-IDN-name-cürl-rüles-la-la-la-dee-da-flooby-nooby.local/page/10
<strip>
^User-Agent:.*
</strip>
<protocol>
GET http://too-long-IDN-name-cürl-rüles-la-la-la-dee-da-flooby-nooby.local/page/1035 HTTP/1.1
Host: too-long-IDN-name-cürl-rüles-la-la-la-dee-da-flooby-nooby.local
Accept: */*
Proxy-Connection: Keep-Alive
</protocol>
<errorcode>
3
</errorcode>
</verify>
</testcase>