Skip to content

alertmanagerconfig: support http_headers - #2465

Merged
AndrewChubatiuk merged 1 commit into
masterfrom
alertmanager-http-headers
Aug 6, 2026
Merged

alertmanagerconfig: support http_headers#2465
AndrewChubatiuk merged 1 commit into
masterfrom
alertmanager-http-headers

Conversation

@AndrewChubatiuk

Copy link
Copy Markdown
Contributor

fixes #2459

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 10 files

Re-trigger cubic

if _, ok := reservedHTTPHeaders[http.CanonicalHeaderKey(name)]; ok {
return fmt.Errorf("setting header %q is not allowed", http.CanonicalHeaderKey(name))
}
}

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.

Check for empty values here:

		if len(config.Values) == 0 && len(config.Secrets) == 0 && len(config.Files) == 0 {
			return fmt.Errorf("header %q must define at least one of values, secrets, or files", name)
		}

"X-Amz-Content-Sha256": {},
}

func validateHTTPHeaderNames(headers map[string]HTTPHeaderConfig) error {

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.

We should validate names too:

import "golang.org/x/net/http/httpguts"
....
		if !httpguts.ValidHeaderFieldName(name) {
			return fmt.Errorf("invalid HTTP header name %q", name)
		}

@AndrewChubatiuk
AndrewChubatiuk force-pushed the alertmanager-http-headers branch from 33f780c to 9ba2b42 Compare August 6, 2026 11:12
@AndrewChubatiuk
AndrewChubatiuk enabled auto-merge (squash) August 6, 2026 11:13
@AndrewChubatiuk
AndrewChubatiuk merged commit a5a6e36 into master Aug 6, 2026
9 checks passed
@AndrewChubatiuk
AndrewChubatiuk deleted the alertmanager-http-headers branch August 6, 2026 11:18
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.

VMAlertmanagerConfig: missing http_headers spec in http_config

2 participants