Skip to content

Commit

Permalink
fix(proxy): HTTP_PROXY env variable was not removed after os_env_prox…
Browse files Browse the repository at this point in the history
…y wrapper (#596)

- we restored only if variable defined
- need to remove if no variable defined
  • Loading branch information
jmkerloch authored Dec 6, 2024
2 parents 6cf4588 + e480387 commit 97fcf01
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion qgis_deployment_toolbelt/utils/proxies.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,15 @@ def wrapper(*args, **kwargs):
# Run function
result = func(*args, **kwargs)

# Restore environment variable if available
# Restore environment variable if available or remove it
if prev_http_proxy:
os.environ["HTTP_PROXY"] = prev_http_proxy
elif "HTTP_PROXY" in os.environ:
del os.environ["HTTP_PROXY"]
if prev_https_proxy:
os.environ["HTTPS_PROXY"] = prev_https_proxy
elif "HTTPS_PROXY" in os.environ:
del os.environ["HTTPS_PROXY"]
return result

return wrapper
Expand Down

0 comments on commit 97fcf01

Please sign in to comment.