Skip to content

fix: enforce validation for empty custom_headers in webhook configurations#674

Open
alexbouchardd wants to merge 1 commit intomainfrom
chore/update-custom-header-validate
Open

fix: enforce validation for empty custom_headers in webhook configurations#674
alexbouchardd wants to merge 1 commit intomainfrom
chore/update-custom-header-validate

Conversation

@alexbouchardd
Copy link
Contributor

  • Updated tests to ensure that an error is returned when custom_headers is empty or invalid.
  • Modified the WebhookDestination and StandardWebhookDestination to return validation errors for empty custom_headers.
  • Adjusted frontend logic to handle empty custom_headers appropriately, ensuring backward compatibility while enforcing validation rules.

…tions

- Updated tests to ensure that an error is returned when custom_headers is empty or invalid.
- Modified the WebhookDestination and StandardWebhookDestination to return validation errors for empty custom_headers.
- Adjusted frontend logic to handle empty custom_headers appropriately, ensuring backward compatibility while enforcing validation rules.
@vercel
Copy link

vercel bot commented Feb 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
outpost-docs Ready Ready Preview, Comment Feb 4, 2026 9:21pm
outpost-website Ready Ready Preview, Comment Feb 4, 2026 9:21pm

Request Review

var validationErr *destregistry.ErrDestinationValidation
assert.ErrorAs(t, err, &validationErr)
assert.Equal(t, "config.custom_headers", validationErr.Errors[0].Field)
assert.Equal(t, "required", validationErr.Errors[0].Type)
Copy link
Collaborator

Choose a reason for hiding this comment

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

hey the test suite is failing because the assertion here is incorrect. Based on the error you're throwing, it should be "invalid" instead of "required"

Image

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