Skip to content

Commit 2977741

Browse files
committed
Fixed unexpected end of JSON input (#1)
1 parent 51b662f commit 2977741

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/webhook.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ func (w Webhook) StartServer(handler func(map[string]interface{})) error {
2929
log.Fatal(err)
3030
}
3131

32+
if !json.Valid(body) {
33+
return
34+
}
35+
3236
var data map[string]interface{}
3337

3438
err = json.Unmarshal(body, &data)

0 commit comments

Comments
 (0)