Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(proxy): HTTP_PROXY env variable was not removed after os_env_proxy wrapper #596

Merged
merged 1 commit into from
Dec 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading