diff options
author | Matthew Leeds <matthew.leeds@endlessm.com> | 2019-04-02 13:40:11 -0700 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2019-04-02 20:44:08 +0000 |
commit | da57956327d601aa489392cd94e3f976dca29739 (patch) | |
tree | 69c2b670ec735089a9e74e3ce2dff333812c7d6b /src/libostree/ostree-fetcher-soup.c | |
parent | c9725d0befe0d79931c26483f61acf6b848f452c (diff) | |
download | ostree-da57956327d601aa489392cd94e3f976dca29739.tar.gz |
lib: Check for http_proxy being the empty string
On at least one user's computer, g_getenv("http_proxy") returns the
empty string, so check for that and treat it as no proxy rather than
printing a warning.
See https://github.com/flatpak/flatpak/issues/2790
Closes: #1835
Approved by: cgwalters
Diffstat (limited to 'src/libostree/ostree-fetcher-soup.c')
-rw-r--r-- | src/libostree/ostree-fetcher-soup.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libostree/ostree-fetcher-soup.c b/src/libostree/ostree-fetcher-soup.c index 3951a927..970ac7a4 100644 --- a/src/libostree/ostree-fetcher-soup.c +++ b/src/libostree/ostree-fetcher-soup.c @@ -645,7 +645,7 @@ _ostree_fetcher_constructed (GObject *object) } http_proxy = g_getenv ("http_proxy"); - if (http_proxy != NULL) + if (http_proxy != NULL && http_proxy[0] != '\0') _ostree_fetcher_set_proxy (self, http_proxy); /* FIXME Maybe implement GInitableIface and use g_thread_try_new() @@ -711,7 +711,7 @@ _ostree_fetcher_set_proxy (OstreeFetcher *self, SoupURI *proxy_uri; g_return_if_fail (OSTREE_IS_FETCHER (self)); - g_return_if_fail (http_proxy != NULL); + g_return_if_fail (http_proxy != NULL && http_proxy[0] != '\0'); proxy_uri = soup_uri_new (http_proxy); |