Skip to content

fix: treat the <empty> proxy as a direct connection on Windows and macOS - #175

Merged
jpnurmi merged 1 commit into
getsentry:getsentryfrom
orenjp:fix/empty-proxy-direct
Oct 19, 2026
Merged

jpnurmi merged 1 commit into
getsentry:getsentryfrom
orenjp:fix/empty-proxy-direct

Conversation

@orenjp

@orenjp orenjp commented Oct 18, 2026 •

Copy link
Copy Markdown

sentry-native passes the proxy <empty> to the handler when the SDK's proxy is set to an empty string, which means "no proxy, not even from the environment or the system settings". #119 made the libcurl transport map <empty> to no proxy. The Windows and macOS transports do not handle it yet, which is why sentry-native sends <empty> only on Linux today:

  • Windows: <empty> does not start with http://, so HTTPTransportWin falls back to WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY and uses the system proxy.
  • macOS: <empty> is not empty, so HTTPTransportMac takes the proxy path and passes <empty>/ to CrackURL and the empty port to std::stoi.

This change:

  • Windows: opens the session with WINHTTP_ACCESS_TYPE_NO_PROXY for <empty>.
  • macOS: gives the session an empty connectionProxyDictionary for <empty>. An empty dictionary turns the proxy off; nil would use the system settings.

The sentry-native side, which sends <empty> on every platform and points external/crashpad here, is getsentry/sentry-native#2218. As with #119, the tests are in sentry-native: they set the system proxy on Windows and macOS and check that an empty proxy bypasses it.

…macOS

sentry-native passes `<empty>` when the proxy is explicitly set to an empty
string. The libcurl transport already maps it to no proxy (getsentry#119). The WinHTTP
transport fell back to WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY, and the macOS
transport passed `<empty>/` to CrackURL and std::stoi.

Open the WinHTTP session with WINHTTP_ACCESS_TYPE_NO_PROXY, and give the
macOS session an empty connectionProxyDictionary, which disables the proxy.

@jpnurmi jpnurmi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the fix!

@jpnurmi
jpnurmi merged commit 0bd6ca4 into getsentry:getsentry Oct 19, 2026
24 checks passed
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.

2 participants