fix secret handling by bearer_token

This commit is contained in:
Martin/Geno 2019-06-18 01:02:54 +02:00
parent a57257af26
commit 5b2750557f
No known key found for this signature in database
GPG Key ID: 9D7D3C6BFF600C6A
1 changed files with 2 additions and 1 deletions

View File

@ -45,8 +45,9 @@ func init() {
logger = logger.WithField("body", content)
ok := false
token := strings.TrimSpace(strings.TrimPrefix(r.Header.Get("Authorization"), "Bearer "))
for _, hook := range hooks {
if request.ExternalURL != hook.Secret {
if token != hook.Secret {
continue
}
logger.Infof("run hook")