Skip to content

feat(updater): support custom HTTP headers via updater.conf#54

Open
ranganath42 wants to merge 2 commits into
masterfrom
feat/custom-headers-via-file
Open

feat(updater): support custom HTTP headers via updater.conf#54
ranganath42 wants to merge 2 commits into
masterfrom
feat/custom-headers-via-file

Conversation

@ranganath42

@ranganath42 ranganath42 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Custom HTTP headers via updater.conf

Adds an optional updater.conf file next to the updater binary, letting operators attach custom HTTP headers (tenant IDs, routing tags, etc.) to update checks and downloads. No code changes needed per deployment.

  • New Headers JSON config, fails open if missing or invalid.
  • Validated against RFC 9110. Capped at 4 KB per value, 20 headers, 64 KB file size.
  • Overrides the deprecated updater-profile.conf headers on collision, but cannot override headers describing the binary/host itself (User-Agent, OS headers, hop-by-hop headers).
  • Download now builds a real request (previously plain http.Get, no headers, no error status check).
  • Tests for validation, capping, file loading, and download error handling.

Comment thread updater/update/update.go Outdated
return nil, err
}
req.Header.Set("User-Agent", userAgent())
// Legacy updater-profile.conf headers are set first so that

@ranganath42 ranganath42 Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Here, the header priority is enforced purely by call order.
Reviewers, do you think we should make it a bit more robust by introducing a merge function instead of relying on order? Not trivial, but not a lot of rewrok either.

@ranganath42
ranganath42 marked this pull request as ready for review July 24, 2026 11:13
@ranganath42
ranganath42 force-pushed the feat/custom-headers-via-file branch from e9ab958 to f19a98f Compare July 24, 2026 11:59
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.

1 participant