summaryrefslogtreecommitdiff
path: root/tests/unit
diff options
context:
space:
mode:
authorDaniel Gustafsson <daniel@yesql.se>2018-12-12 11:45:09 +0100
committerDaniel Gustafsson <daniel@yesql.se>2018-12-12 11:48:04 +0100
commitd8607da1a68f2482302ccdbb7cf457210b9ccfc9 (patch)
tree7cdaccafe732cc2e6925bc93c684754587ec1718 /tests/unit
parent4258dc02d86e7e4de9f795a1af3a0bc6732d4ab5 (diff)
downloadcurl-d8607da1a68f2482302ccdbb7cf457210b9ccfc9.tar.gz
urlapi: Fix port parsing of eol colon
A URL with a single colon without a portnumber should use the default port, discarding the colon. Fix, add a testcase and also do little bit of comment wordsmithing. Closes #3365 Reviewed-by: Daniel Stenberg <daniel@haxx.se>
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/unit1653.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/unit/unit1653.c b/tests/unit/unit1653.c
index 9851ee58c..b68d8dc4f 100644
--- a/tests/unit/unit1653.c
+++ b/tests/unit/unit1653.c
@@ -110,6 +110,14 @@ UNITTEST_START
free(ipv6port);
curl_url_cleanup(u);
+ /* Valid IPv6 with no port after the colon, should use default */
+ u = curl_url();
+ ipv6port = strdup("[fe80::250:56ff:fea7:da15]:");
+ ret = Curl_parse_port(u, ipv6port);
+ fail_unless(ret == CURLUE_OK, "Curl_parse_port returned error");
+ free(ipv6port);
+ curl_url_cleanup(u);
+
/* Incorrect zone index syntax */
u = curl_url();
ipv6port = strdup("[fe80::250:56ff:fea7:da15%!25eth3]:80");