diff --git a/gio/gproxyresolver.c b/gio/gproxyresolver.c index bd9528dd0..f72ad2a72 100644 --- a/gio/gproxyresolver.c +++ b/gio/gproxyresolver.c @@ -29,6 +29,7 @@ #include "gcancellable.h" #include "gtask.h" #include "giomodule.h" +#include "gioerror.h" #include "giomodule-priv.h" #include "gnetworkingprivate.h" @@ -147,8 +148,12 @@ g_proxy_resolver_lookup (GProxyResolver *resolver, g_return_val_if_fail (G_IS_PROXY_RESOLVER (resolver), NULL); g_return_val_if_fail (uri != NULL, NULL); - if (!_g_uri_parse_authority (uri, NULL, NULL, NULL, error)) - return NULL; + if (!g_uri_is_valid (uri, G_URI_FLAGS_PARSE_STRICT, NULL)) + { + g_set_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT, + "Invalid URI ā€˜%sā€™", uri); + return NULL; + } iface = G_PROXY_RESOLVER_GET_IFACE (resolver); @@ -181,8 +186,10 @@ g_proxy_resolver_lookup_async (GProxyResolver *resolver, g_return_if_fail (G_IS_PROXY_RESOLVER (resolver)); g_return_if_fail (uri != NULL); - if (!_g_uri_parse_authority (uri, NULL, NULL, NULL, &error)) + if (!g_uri_is_valid (uri, G_URI_FLAGS_PARSE_STRICT, NULL)) { + g_set_error (&error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT, + "Invalid URI ā€˜%sā€™", uri); g_task_report_error (resolver, callback, user_data, g_proxy_resolver_lookup_async, g_steal_pointer (&error));