Skip to content

Commit

Permalink
fix: stop returning webhook secret hash of empty string
Browse files Browse the repository at this point in the history
Signed-off-by: Donnie Adams <[email protected]>
  • Loading branch information
thedadams committed Nov 21, 2024
1 parent 0eafa21 commit e5fc89a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/api/handlers/webhooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ func convertWebhook(webhook v1.Webhook, urlPrefix string) *types.Webhook {
HasToken: len(webhook.Spec.TokenHash) > 0,
}

wh.Secret = fmt.Sprintf("%x", sha256.Sum256([]byte(webhook.Spec.Secret)))
if webhook.Spec.Secret != "" {
wh.Secret = fmt.Sprintf("%x", sha256.Sum256([]byte(webhook.Spec.Secret)))
}

return wh
}
Expand Down

0 comments on commit e5fc89a

Please sign in to comment.