mirror of
https://github.com/alvierahman90/gohookr.git
synced 2024-11-22 08:49:53 +00:00
Actually print calcuated signature to stdout
This commit is contained in:
parent
0953baae50
commit
081aaee9c7
8
main.go
8
main.go
@ -63,9 +63,13 @@ func webhookHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
// Verify that signature provided matches signature calculated using secretsss
|
// Verify that signature provided matches signature calculated using secretsss
|
||||||
signature := r.Header.Get(service.SignatureHeader)
|
signature := r.Header.Get(service.SignatureHeader)
|
||||||
calculatedSignature := fmt.Sprintf("%v%v", service.SignaturePrefix, getSha256HMACSignature([]byte(service.Secret), payload))
|
calculatedSignature := fmt.Sprintf(
|
||||||
|
"%v%v",
|
||||||
|
service.SignaturePrefix,
|
||||||
|
getSha256HMACSignature([]byte(service.Secret), payload),
|
||||||
|
)
|
||||||
fmt.Printf("signature = %v\n", signature)
|
fmt.Printf("signature = %v\n", signature)
|
||||||
fmt.Printf("calcuatedSignature = %v\n", signature)
|
fmt.Printf("calcuatedSignature = %v\n", calculatedSignature)
|
||||||
if signature != calculatedSignature && checkSignature {
|
if signature != calculatedSignature && checkSignature {
|
||||||
writeResponse(w, 400, "Bad Request: Signatures do not match")
|
writeResponse(w, 400, "Bad Request: Signatures do not match")
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user