Skip to content

Support empty webhook header prefix#797

Merged
alexluong merged 1 commit intomainfrom
feat/575-empty-header-prefix
Mar 25, 2026
Merged

Support empty webhook header prefix#797
alexluong merged 1 commit intomainfrom
feat/575-empty-header-prefix

Conversation

@alexluong
Copy link
Copy Markdown
Collaborator

Summary

  • Closes Support empty webhook header prefix #575
  • Allow disabling the webhook header prefix by setting it to whitespace (e.g. header_prefix: " " or DESTINATIONS_WEBHOOK_HEADER_PREFIX=" ")
  • Config layer keeps string type (env/v9 doesn't support *string), converts to *string at the toConfig() boundary
  • Provider WithHeaderPrefix(*string): nil keeps default prefix, non-nil applies value with strings.TrimSpace (whitespace → empty = no prefix)
  • Uses Go 1.26 new("value") syntax for pointer literals in tests

How it works

Config value Provider receives Result
unset / "" nil Default prefix (x-outpost- or webhook-)
" " (whitespace) &" " → trimmed to "" No prefix
"x-custom-" &"x-custom-" Custom prefix

Test plan

  • make test all green
  • Config tests: default, yaml, env override, whitespace via yaml/env
  • destwebhook tests: nil/empty/whitespace/custom prefix
  • destwebhookstandard tests: nil/empty/whitespace/custom prefix
  • gofmt clean

Depends on #796 (Kafka test fix)

🤖 Generated with Claude Code

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 25, 2026

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

Project Deployment Actions Updated (UTC)
outpost-docs Ready Ready Preview, Comment Mar 25, 2026 10:12pm
outpost-website Ready Ready Preview, Comment Mar 25, 2026 10:12pm

Request Review

Base automatically changed from fix/kafka-test-sasl to main March 25, 2026 20:55
Allow disabling the webhook header prefix by setting it to whitespace
(e.g. " "). The provider trims whitespace, so " " effectively sets
the prefix to empty string.

- Config `toConfig()` converts string→*string: empty=""→nil (default),
  non-empty→&value
- `WithHeaderPrefix(*string)`: nil keeps default, non-nil applies with
  TrimSpace
- Add tests for nil/empty/whitespace/custom prefix in both providers

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@alexluong alexluong force-pushed the feat/575-empty-header-prefix branch from 5796fbf to 83c547f Compare March 25, 2026 22:11
@alexluong alexluong merged commit c9d987d into main Mar 25, 2026
4 checks passed
@alexluong alexluong deleted the feat/575-empty-header-prefix branch March 25, 2026 22:30
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.

Support empty webhook header prefix

2 participants