summaryrefslogtreecommitdiff
path: root/plugins/shell-proxy/proxy.py
diff options
context:
space:
mode:
authorSepts <github@septs.pw>2021-04-06 20:49:03 +0800
committerGitHub <noreply@github.com>2021-04-06 14:49:03 +0200
commit2e487b187eac96ac63c8bd0f5e3c28d5ed06d828 (patch)
tree47448822d17fc5649ccce0a56f9bb0a0700d98df /plugins/shell-proxy/proxy.py
parent790f185e0fd8b70eab33847afe02af07f6af3a1e (diff)
downloadzsh-2e487b187eac96ac63c8bd0f5e3c28d5ed06d828.tar.gz
zsh-2e487b187eac96ac63c8bd0f5e3c28d5ed06d828.tar.bz2
zsh-2e487b187eac96ac63c8bd0f5e3c28d5ed06d828.zip
feat(shell-proxy): enable unexported `DEFAULT_PROXY` setting (#9774)
Diffstat (limited to 'plugins/shell-proxy/proxy.py')
-rwxr-xr-xplugins/shell-proxy/proxy.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/shell-proxy/proxy.py b/plugins/shell-proxy/proxy.py
index d2e5361cb..97f4cf873 100755
--- a/plugins/shell-proxy/proxy.py
+++ b/plugins/shell-proxy/proxy.py
@@ -9,8 +9,9 @@ user_proxy = os.environ.get("CONFIG_PROXY", os.path.expandvars("$HOME/.config/pr
def get_http_proxy():
- if "DEFAULT_PROXY" in os.environ:
- return os.environ["DEFAULT_PROXY"]
+ default_proxy = os.environ.get("DEFAULT_PROXY")
+ if default_proxy:
+ return default_proxy
if os.path.isfile(user_proxy):
return check_output(user_proxy).decode("utf-8").strip()
raise Exception("Not found, Proxy configuration")