fix(darwin): disable PAC mode on set/unset global#11
Merged
Conversation
Ensure manual/global proxy operations turn off autoproxy state on macOS so get() no longer returns stale PAC after unset.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
Fixes a macOS-specific proxy-state inconsistency where PAC (Auto Proxy URL) could remain active after global proxy changes, causing get/GetConfig to report a stale PAC URL.
Changes:
- Disable macOS auto-proxy (PAC) mode when setting a global manual proxy.
- Disable macOS auto-proxy (PAC) mode when unsetting the global proxy.
- Disable macOS auto-proxy (PAC) mode when applying multi-protocol global proxy settings.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+22
to
+23
| // Ensure manual proxy mode is authoritative and PAC does not stay active. | ||
| _ = runNetworkSetup(ctx, "-setautoproxystate", svc, "off") |
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.
Fixes stale PAC behavior on macOS: after unset --scope global, get could still return Auto Proxy URL.\n\nChanges:\n- disable autoproxy state in setGlobal\n- disable autoproxy state in unsetGlobal\n- disable autoproxy state in setGlobalMulti\n\nValidated with:\n- go test -race -count=1 ./...\n- golangci-lint run ./...\n- local smoke cycle set->get->unset with state restore