Repository navigation
Conversation
added 2 commits
October 18, 2026 22:28
The existing empty-proxy tests set only the `http_proxy`/`https_proxy` environment variables, which the WinHTTP transport and the Windows and macOS crashpad handlers never read, so they pass whether or not an empty proxy turns proxy discovery off. Add a `system_proxy` helper that points the current user's system proxy at the test proxy (WinINet on Windows, `networksetup` on macOS) and restores it afterwards. The tests run each backend once with the system proxy and once with the system proxy plus an empty `proxy` option: the first checks that the system proxy is in use, the second that the empty option bypasses it. The native backend also gets the environment-variable test that the other backends have.
`sentry_options_set_proxy(options, "")` turned off the proxy only where libcurl is used. Elsewhere it fell back to proxy discovery: - WinHTTP transport: opened the session with WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY, which reads the system settings. - crashpad backend: passed `<empty>` to the handler only on Linux, so the Windows and macOS handlers used the system settings. - native backend: the daemon applied the proxy only when it was not empty, so it fell back to the environment variables and system settings. Open the WinHTTP session with WINHTTP_ACCESS_TYPE_NO_PROXY for an empty proxy, pass `<empty>` to the crashpad handler on every platform, and tell the native daemon whether a proxy was set. The crashpad submodule update makes the Windows and macOS handlers treat `<empty>` as a direct connection.
This was referenced Oct 18, 2026
Open
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #2218 +/- ##
==========================================
+ Coverage 75.61% 75.69% +0.08%
==========================================
Files 103 103
Lines 28261 28263 +2
Branches 5179 5180 +1
==========================================
+ Hits 21369 21394 +25
+ Misses 5536 5524 -12
+ Partials 1356 1345 -11 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
sentry_options_set_proxy(options, "")is meant to turn the proxy off. Today it does so only where libcurl is used. Everywhere else, an empty proxy falls back to proxy discovery:""before""afterWINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY)<empty>)http_proxy/https_proxy, then the system proxy on WindowsThe default (no
sentry_options_set_proxycall) does not change.This PR makes the following changes:
WINHTTP_ACCESS_TYPE_NO_PROXYfor an empty proxy.<empty>to the handler on every platform, not only on Linux.""from no proxy. The shared context now carrieshas_proxy.external/crashpad: points at fix: treat the<empty>proxy as a direct connection on Windows and macOS crashpad#175, which makes the Windows and macOS handlers treat<empty>as a direct connection.sentry.h: thesentry_options_set_proxydoc says what an empty string does.Tests
The existing
test_proxy_set_emptyandtest_crashpad_proxy_set_emptyset only the proxy environment variables. The WinHTTP transport and the Windows and macOS handlers never read those, so both tests pass with or without this change.The new
system_proxyhelper intests/proxy.pysets the current user's system proxy to the test proxy and restores it afterwards: WinINet on Windows,networksetup(withsudo -n) on macOS. It skips on other platforms. These tests use it:test_proxy_system, for the WinHTTP transport on Windows.test_crashpad_proxy_system, on Windows and macOS.test_native_proxy_system, on Windows.Each runs twice. With
proxy_empty=Falseit checks that the request goes through the system proxy, which proves the setup works. Withproxy_empty=Trueit checks that the proxy sees no request.test_native_proxy_set_emptyis the environment-variable test the other backends already have.The first commit adds only the tests, so CI shows them failing without the fix:
Related: getsentry/crashpad#176, a separate fix for the macOS proxy upload, which stops waiting after 10 seconds.