Recognise :PORT as a valid URL

This commit is contained in:
Sergey Lyubka committed 2021-11-29 13:57:33 +00:00
1 parent 81220fa590
commit 9731a51dae
3 files changed
+20 -2

No files matched your search

+2
View File
@@ -121,6 +121,7 @@ static void test_url(void) {
ASSERT(vcmp(mg_url_host("foo"), "foo"));
ASSERT(vcmp(mg_url_host("//foo"), "foo"));
ASSERT(vcmp(mg_url_host("foo:1234"), "foo"));
ASSERT(vcmp(mg_url_host(":1234"), ""));
ASSERT(vcmp(mg_url_host("//foo:1234"), "foo"));
ASSERT(vcmp(mg_url_host("p://foo"), "foo"));
ASSERT(vcmp(mg_url_host("p://foo/"), "foo"));
@@ -141,6 +142,7 @@ static void test_url(void) {
// Port
ASSERT(mg_url_port("foo:1234") == 1234);
ASSERT(mg_url_port(":1234") == 1234);
ASSERT(mg_url_port("x://foo:1234") == 1234);
ASSERT(mg_url_port("x://foo:1234/") == 1234);
ASSERT(mg_url_port("x://foo:1234/xx") == 1234);