Skip to content

Commit 7d3b097

Browse files
authored
fix: use correct default header prefix for standard webhook mode (#665)
* chore: make nuke/deps * fix: use correct default header prefix for standard webhook mode
1 parent d6e93ef commit 7d3b097

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ up/deps:
5959
down/deps:
6060
COMPOSE_PROFILES=$$(./build/dev/deps/profiles.sh --all) docker-compose -f build/dev/deps/compose.yml -f build/dev/deps/compose-gui.yml down
6161

62+
nuke/deps:
63+
COMPOSE_PROFILES=$$(docker compose -f build/dev/deps/compose.yml -f build/dev/deps/compose-gui.yml config --profiles | paste -sd, -) docker compose -f build/dev/deps/compose.yml -f build/dev/deps/compose-gui.yml down --volumes --remove-orphans
64+
6265
up/mqs:
6366
docker-compose -f build/dev/mqs/compose.yml up -d
6467

internal/config/config.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ func (c *Config) InitDefaults() {
178178
c.Destinations = DestinationsConfig{
179179
MetadataPath: "config/outpost/destinations",
180180
Webhook: DestinationWebhookConfig{
181-
HeaderPrefix: "x-outpost-",
182181
SignatureContentTemplate: "{{.Body}}",
183182
SignatureHeaderTemplate: "v0={{.Signatures | join \",\"}}",
184183
SignatureEncoding: "hex",

internal/config/config_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ func TestDefaultValues(t *testing.T) {
7171
assert.Equal(t, "config/outpost/destinations", cfg.Destinations.MetadataPath)
7272
assert.Equal(t, 10, cfg.LogBatchThresholdSeconds)
7373
assert.Equal(t, 1000, cfg.LogBatchSize)
74-
assert.Equal(t, "x-outpost-", cfg.Destinations.Webhook.HeaderPrefix)
74+
assert.Equal(t, "", cfg.Destinations.Webhook.HeaderPrefix)
7575
}
7676

7777
func TestYAMLConfig(t *testing.T) {
@@ -328,7 +328,7 @@ func TestDestinationConfig(t *testing.T) {
328328
name: "default header prefix",
329329
files: map[string][]byte{},
330330
envVars: map[string]string{},
331-
want: "x-outpost-",
331+
want: "",
332332
},
333333
{
334334
name: "yaml config header prefix",

internal/destregistry/providers/destwebhook/destwebhook.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,9 @@ type Option func(*WebhookDestination)
116116
// WithHeaderPrefix sets a custom prefix for webhook request headers
117117
func WithHeaderPrefix(prefix string) Option {
118118
return func(w *WebhookDestination) {
119-
w.headerPrefix = prefix
119+
if prefix != "" {
120+
w.headerPrefix = prefix
121+
}
120122
}
121123
}
122124

0 commit comments

Comments
 (0)