Skip to content

fix: viper issue in parsing sync headers #9

Merged
raflFaisal merged 1 commit intobooking-mainfrom
frafiuddin/fixViperIssueWithParsingHeaders
May 4, 2026
Merged

fix: viper issue in parsing sync headers #9
raflFaisal merged 1 commit intobooking-mainfrom
frafiuddin/fixViperIssueWithParsingHeaders

Conversation

@raflFaisal
Copy link
Copy Markdown

@raflFaisal raflFaisal commented May 4, 2026

Summary

Viper cannot parse StringToString flags from environment variables. This adds a manual fallback parser for FLAGD_SYNC_HEADERS and canonicalizes header keys for case-insensitive merging.

Changes

  • flagd/cmd/start.go — Add parseSyncHeaders() fallback that manually parses key=value,key=value format; use case-insensitive comparison when merging global headers
  • flagd/cmd/start_test.go — Unit tests for the header parser
  • core/pkg/sync/http/http_sync.go — Canonicalize header keys with http.CanonicalHeaderKey
  • core/pkg/sync/http/http_sync_test.go — Consolidate header tests into table-driven format

@raflFaisal raflFaisal force-pushed the frafiuddin/fixViperIssueWithParsingHeaders branch from 1dc6ae7 to f24379d Compare May 4, 2026 01:04
@raflFaisal raflFaisal changed the title fix viper issue in parsing headers fix: viper issue in parsing sync headers May 4, 2026
@raflFaisal raflFaisal merged commit d5de686 into booking-main May 4, 2026
1 of 2 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