gio: use g_uri_split_network() in g_simple_proxy_resolver_lookup()

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
Marc-André Lureau 2020-07-07 13:03:44 +04:00
parent 1b6a0535e8
commit aa0b09ebef

View File

@ -327,10 +327,11 @@ g_simple_proxy_resolver_lookup (GProxyResolver *proxy_resolver,
if (priv->ignore_ips || priv->ignore_domains)
{
gchar *host = NULL;
gushort port;
gint port;
if (_g_uri_parse_authority (uri, &host, &port, NULL, NULL) &&
ignore_host (resolver, host, port))
if (g_uri_split_network (uri, G_URI_FLAGS_PARSE_STRICT, NULL,
&host, &port, NULL) &&
ignore_host (resolver, host, port > 0 ? port : 0))
proxy = "direct://";
g_free (host);