From 1c3f992f110e522d19265214b1c20e4c3781b669 Mon Sep 17 00:00:00 2001 From: Michael Catanzaro Date: Tue, 6 Dec 2022 19:27:23 +0000 Subject: [PATCH 1/2] Revert "gsimpleproxyresolver: Make explicit that a port is needed for HTTP/HTTPS" This reverts commit eb12afed6f36db6212228b1e1fbaf87ed5606173 Instead, let's allow use of URIs without ports specified, which indicates that a default port should be used. --- gio/gsimpleproxyresolver.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/gio/gsimpleproxyresolver.c b/gio/gsimpleproxyresolver.c index fc4432921..8de26cb7b 100644 --- a/gio/gsimpleproxyresolver.c +++ b/gio/gsimpleproxyresolver.c @@ -426,10 +426,6 @@ g_simple_proxy_resolver_class_init (GSimpleProxyResolverClass *resolver_class) * Note that as a special case, if this URI starts with * "socks://", #GSimpleProxyResolver will treat it as referring * to all three of the socks5, socks4a, and socks4 proxy types. - * - * If you are making an HTTP or HTTPS proxy resolver, you must explicitly - * add the port to the URI even if the default port is used. For example: - * `https://example.com:443` or `http://example.com:80`. */ g_object_class_install_property (object_class, PROP_DEFAULT_PROXY, g_param_spec_string ("default-proxy", From d246d09e5bd4977bfa7eb6e86d5ca978b4089c50 Mon Sep 17 00:00:00 2001 From: Michael Catanzaro Date: Thu, 22 Dec 2022 15:34:44 -0600 Subject: [PATCH 2/2] gproxyresolver: allow implicit ports in URIs If the port is not specified, then a default port should be assumed. This is how everybody expects URIs to work and it's how GProxyResolver should work too. We already have lots of tests to ensure this works as expected; however, the documentation currently does not allow it. Change the documentation to match reality. Fixes #2832 --- gio/gproxyresolver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gio/gproxyresolver.c b/gio/gproxyresolver.c index 61f61a797..8a69b202a 100644 --- a/gio/gproxyresolver.c +++ b/gio/gproxyresolver.c @@ -131,7 +131,7 @@ g_proxy_resolver_is_supported (GProxyResolver *resolver) * * Looks into the system proxy configuration to determine what proxy, * if any, to use to connect to @uri. The returned proxy URIs are of - * the form `://[user[:password]@]host:port` or + * the form `://[user[:password]@]host[:port]` or * `direct://`, where could be http, rtsp, socks * or other proxying protocol. *