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

Add NO_PROXY support #488

Merged
merged 4 commits into from
Oct 5, 2023
Merged

Add NO_PROXY support #488

merged 4 commits into from
Oct 5, 2023

Conversation

mmarchetti
Copy link
Contributor

This PR adds support for NO_PROXY. It's based on #480, but on a local branch.

Intent

Fixes #400

Type of Change

  • Bug Fix
  • New Feature
  • Breaking Change

Directions for Reviewers

Deploy content:

  • Without a proxy
  • With a proxy: Proxy should be used.
  • With a proxy, and NO_PROXY set but not matching the host. Proxy should be used.
  • With a proxy, and NO_PROXY set and matching the host: Proxy should NOT be used.

Checklist

  • I have updated CHANGELOG.md to cover notable changes.
  • I have updated all related GitHub issues to reflect their current state.

@github-actions
Copy link

github-actions bot commented Oct 3, 2023

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
4299 2786 65% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
rsconnect/http_support.py 85% 🟢
TOTAL 85% 🟢

updated for commit: 2b8dc59 by action🐍

@mmarchetti mmarchetti requested a review from tdstein October 4, 2023 18:12
@@ -75,7 +75,12 @@ def _create_ssl_connection(host_name, port, disable_tls_check, ca_data):
"""
if ca_data is not None and disable_tls_check:
raise ValueError("Cannot both disable TLS checking and provide a custom certificate")
_, _, proxyHost, proxyPort = _get_proxy()

no_proxy = os.environ.get("no_proxy", os.environ.get("NO_PROXY", "#"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the default value '#'?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It won't ever match a hostname. Since the check is endswith, an empty string would be interpreted as matching all hosts.

@mmarchetti mmarchetti merged commit f4def0c into master Oct 5, 2023
13 checks passed
@mmarchetti mmarchetti deleted the no-proxy branch October 5, 2023 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rsconnect-python doesn't support no_proxy variable
2 participants