mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-08 02:16:17 +01:00
Merge branch 'uri-ipv6-bkt' into 'master'
uri: do not add ipv6 brackets on non-ip host See merge request GNOME/glib!1599
This commit is contained in:
commit
a97fe4e863
@ -1383,7 +1383,7 @@ g_uri_join_internal (GUriFlags flags,
|
|||||||
g_string_append_c (str, '@');
|
g_string_append_c (str, '@');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strchr (host, ':'))
|
if (strchr (host, ':') && g_hostname_is_ip_address (host))
|
||||||
{
|
{
|
||||||
g_string_append_c (str, '[');
|
g_string_append_c (str, '[');
|
||||||
if (encoded)
|
if (encoded)
|
||||||
|
@ -669,6 +669,9 @@ static const UriAbsoluteTest absolute_tests[] = {
|
|||||||
{ "http://:@host",
|
{ "http://:@host",
|
||||||
{ "http", ":", "host", -1, "", NULL, NULL }
|
{ "http", ":", "host", -1, "", NULL, NULL }
|
||||||
},
|
},
|
||||||
|
{ "scheme://foo%3Abar._webdav._tcp.local",
|
||||||
|
{ "scheme", NULL, "foo:bar._webdav._tcp.local", -1, "", NULL, NULL}
|
||||||
|
},
|
||||||
|
|
||||||
/* IPv6 scope ID parsing (both correct and incorrect) */
|
/* IPv6 scope ID parsing (both correct and incorrect) */
|
||||||
{ "http://[fe80::dead:beef%em1]/",
|
{ "http://[fe80::dead:beef%em1]/",
|
||||||
@ -1410,6 +1413,10 @@ test_uri_join (void)
|
|||||||
g_assert_cmpstr (uri, ==,
|
g_assert_cmpstr (uri, ==,
|
||||||
"scheme://user%01:pass%02;authparams%03@[::192.9.5.5]:9876/path?query#fragment");
|
"scheme://user%01:pass%02;authparams%03@[::192.9.5.5]:9876/path?query#fragment");
|
||||||
g_free (uri);
|
g_free (uri);
|
||||||
|
|
||||||
|
uri = g_uri_join (G_URI_FLAGS_NONE, "scheme", NULL, "foo:bar._webdav._tcp.local", -1, "", NULL, NULL);
|
||||||
|
g_assert_cmpstr (uri, ==, "scheme://foo%3Abar._webdav._tcp.local");
|
||||||
|
g_free (uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
Loading…
Reference in New Issue
Block a user