fix(config): resolve boolean inheritance bug for target overrides#40
Merged
pgagnidze merged 1 commit intoOwloops:mainfrom Apr 21, 2026
Merged
fix(config): resolve boolean inheritance bug for target overrides#40pgagnidze merged 1 commit intoOwloops:mainfrom
pgagnidze merged 1 commit intoOwloops:mainfrom
Conversation
The bool fields FollowRedirects, AcceptRedirects, ReceiveAlert, and SkipSSL could not be overridden to false at target level when the global value was true (false == zero value == not set). Convert to *bool with nil handling in the merge: nil inherits from global, explicit value is preserved. Add test demonstrating the bug. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 tasks
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.
Problem
Bool fields in
Target(SkipSSL,FollowRedirects,AcceptRedirects,ReceiveAlert) used plainbool. The merge logic inLoadConfigwas:This makes it impossible for a target to explicitly set a field to
falsewhen the global value is
true— the zero value ofboolis indistinguishablefrom an intentional
false.Fix
Changed the 4 fields to
*bool. Anilpointer means "not set" and inheritsfrom global; a non-nil pointer preserves the target's explicit value.
Added
BoolVal(p *bool, fallback bool) boolhelper for consumers.Added a regression test that demonstrates the bug before the fix.