From aadb7c7b62251c4e760930d543105f2b10cbd9b2 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 6 Mar 2017 16:08:21 +0100 Subject: URL: return error on malformed URLs with junk after port number ... because it causes confusion with users. Example URLs: "http://[127.0.0.1]:11211:80" which a lot of languages' URL parsers will parse and claim uses port number 80, while libcurl would use port number 11211. "http://user@example.com:80@localhost" which by the WHATWG URL spec will be treated to contain user name 'user@example.com' but according to RFC3986 is user name 'user' for the host 'example.com' and then port 80 is followed by "@localhost" Both these formats are now rejected, and verified so in test 1260. Reported-by: Orange Tsai --- tests/data/test1260 | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 tests/data/test1260 (limited to 'tests/data/test1260') diff --git a/tests/data/test1260 b/tests/data/test1260 new file mode 100644 index 000000000..b5a0aef97 --- /dev/null +++ b/tests/data/test1260 @@ -0,0 +1,34 @@ + + + +HTTP +HTTP GET + + + +# Server-side + + + +# Client-side + + +none + + +HTTP URL with rubbish after port number + + +-g "http://[%HOSTIP]:%HTTPPORT:80/we/want/1260" "http://%HOSTIP:%HTTPPORT:80/we/want/1260" "http://user@example.com:80@localhost" + + + +# Verify data after the test has been "shot" + +# CURLE_URL_MALFORMAT == 3 + +3 + + + + -- cgit v1.2.3