-
Notifications
You must be signed in to change notification settings - Fork 503
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose proxy_headers as top level config and use in ProxyManager
- Loading branch information
1 parent
442e71c
commit 3fb3fa0
Showing
3 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -227,6 +227,16 @@ def test_transport_option(monkeypatch): | |
"arg_https_proxy": "https://localhost/123", | ||
"expected_proxy_scheme": "https", | ||
}, | ||
{ | ||
"dsn": "https://[email protected]/123", | ||
"env_http_proxy": None, | ||
"env_https_proxy": None, | ||
"env_no_proxy": "sentry.io,example.com", | ||
"arg_http_proxy": None, | ||
"arg_https_proxy": "https://localhost/123", | ||
"expected_proxy_scheme": "https", | ||
"arg_proxy_headers": {"Test-Header": "foo-bar"}, | ||
}, | ||
], | ||
) | ||
def test_proxy(monkeypatch, testcase): | ||
|
@@ -241,12 +251,17 @@ def test_proxy(monkeypatch, testcase): | |
kwargs["http_proxy"] = testcase["arg_http_proxy"] | ||
if testcase["arg_https_proxy"] is not None: | ||
kwargs["https_proxy"] = testcase["arg_https_proxy"] | ||
if testcase.get("arg_proxy_headers") is not None: | ||
kwargs["proxy_headers"] = testcase["arg_proxy_headers"] | ||
client = Client(testcase["dsn"], **kwargs) | ||
if testcase["expected_proxy_scheme"] is None: | ||
assert client.transport._pool.proxy is None | ||
else: | ||
assert client.transport._pool.proxy.scheme == testcase["expected_proxy_scheme"] | ||
|
||
if testcase.get("arg_proxy_headers") is not None: | ||
assert client.transport._pool.proxy_headers == testcase["arg_proxy_headers"] | ||
|
||
|
||
def test_simple_transport(sentry_init): | ||
events = [] | ||
|