Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c271ec3e32 | |||
| 0c4911f7f5 |
@@ -80,11 +80,15 @@ func (hook Webhook) ParsePayload(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
webhooks.DefaultLog.Debug(fmt.Sprintf("X-Hook-UUID:%s", uuid))
|
webhooks.DefaultLog.Debug(fmt.Sprintf("X-Hook-UUID:%s", uuid))
|
||||||
|
|
||||||
|
if len(hook.uuid) > 0 {
|
||||||
if uuid != hook.uuid {
|
if uuid != hook.uuid {
|
||||||
webhooks.DefaultLog.Error(fmt.Sprintf("X-Hook-UUID does not match configured uuid of %s", hook.uuid))
|
webhooks.DefaultLog.Error(fmt.Sprintf("X-Hook-UUID %s does not match configured uuid of %s", uuid, hook.uuid))
|
||||||
http.Error(w, "403 Forbidden - X-Hook-UUID does not match", http.StatusForbidden)
|
http.Error(w, "403 Forbidden - X-Hook-UUID does not match", http.StatusForbidden)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
webhooks.DefaultLog.Debug("hook uuid not defined - recommend setting for improved security")
|
||||||
|
}
|
||||||
|
|
||||||
event := r.Header.Get("X-Event-Key")
|
event := r.Header.Get("X-Event-Key")
|
||||||
if event == "" {
|
if event == "" {
|
||||||
|
|||||||
Reference in New Issue
Block a user