Skip to content

Commit 0b269e4

Browse files
committed
fixed payload-hash-sha1 for github header
1 parent 40d01e4 commit 0b269e4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

helpers/helpers.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ import (
1212

1313
// CheckPayloadSignature calculates and verifies SHA1 signature of the given payload
1414
func CheckPayloadSignature(payload []byte, secret string, signature string) (string, bool) {
15+
if strings.HasPrefix(signature, "sha1=") {
16+
signature = signature[5:]
17+
}
18+
1519
mac := hmac.New(sha1.New, []byte(secret))
1620
mac.Write(payload)
1721
expectedMAC := hex.EncodeToString(mac.Sum(nil))

0 commit comments

Comments
 (0)