Include ipv6 wrapping brackets [] in the result of mg_url_host()

This commit is contained in:
Sergey Lyubka committed 2021-09-21 08:10:27 +01:00
1 parent 8652006aea
commit 90a131bd29
5 files changed
+10 -15

No files matched your search

+2 -2
View File
@@ -135,8 +135,8 @@ static void test_url(void) {
ASSERT(vcmp(mg_url_host("p://bar:1234/a"), "bar"));
ASSERT(vcmp(mg_url_host("p://u@bar:1234/a"), "bar"));
ASSERT(vcmp(mg_url_host("p://u:p@bar:1234/a"), "bar"));
ASSERT(vcmp(mg_url_host("p://u:p@[::1]:1234/a"), "::1"));
ASSERT(vcmp(mg_url_host("p://u:p@[1:2::3]:1234/a"), "1:2::3"));
ASSERT(vcmp(mg_url_host("p://u:p@[::1]:1234/a"), "[::1]"));
ASSERT(vcmp(mg_url_host("p://u:p@[1:2::3]:1234/a"), "[1:2::3]"));
ASSERT(vcmp(mg_url_host("p://foo/x:y/z"), "foo"));
// Port