summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Gustafsson <daniel@yesql.se>2018-12-30 20:11:57 +0100
committerDaniel Gustafsson <daniel@yesql.se>2018-12-30 20:11:57 +0100
commita4482b21bd8bb0ac7cfb3471bad32bf84f829805 (patch)
treecd1eff185c2ca2f2d56b4dca942de741a2b97862 /tests
parent2a8801d7ba5ec91fb2db83d8627587a5e0c0f5a5 (diff)
downloadgnurl-a4482b21bd8bb0ac7cfb3471bad32bf84f829805.tar.gz
gnurl-a4482b21bd8bb0ac7cfb3471bad32bf84f829805.tar.bz2
gnurl-a4482b21bd8bb0ac7cfb3471bad32bf84f829805.zip
urlapi: fix parsing ipv6 with zone index
The previous fix for parsing IPv6 URLs with a zone index was a paddle short for URLs without an explicit port. This patch fixes that case and adds a unit test case. This bug was highlighted by issue #3408, and while it's not the full fix for the problem there it is an isolated bug that should be fixed regardless. Closes #3411 Reported-by: GitYuanQu on github Reviewed-by: Daniel Stenberg <daniel@haxx.se>
Diffstat (limited to 'tests')
-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 b68d8dc4f..4e326f51b 100644
--- a/tests/unit/unit1653.c
+++ b/tests/unit/unit1653.c
@@ -83,6 +83,14 @@ UNITTEST_START
free(ipv6port);
curl_url_cleanup(u);
+ /* Valid IPv6 with zone index without port number */
+ u = curl_url();
+ ipv6port = strdup("[fe80::250:56ff:fea7:da15%25eth3]");
+ ret = Curl_parse_port(u, ipv6port);
+ fail_unless(ret == CURLUE_OK, "Curl_parse_port returned error");
+ free(ipv6port);
+ curl_url_cleanup(u);
+
/* Valid IPv6 with port number */
u = curl_url();
ipv6port = strdup("[fe80::250:56ff:fea7:da15]:81");