Skip to content

Commit

Permalink
chose: cancel the assignment and judge later (zeromicro#1359)
Browse files Browse the repository at this point in the history
Co-authored-by: charliecen <chq@abierr.com>
  • Loading branch information
charliecen and charliecen authored Dec 22, 2021
1 parent 6f1d273 commit d5e4933
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion rest/internal/security/contentsecurity.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,20 @@ func VerifySignature(r *http.Request, securityHeader *ContentSecurityHeader, tol
}, "\n")
actualSignature := codec.HmacBase64(securityHeader.Key, signContent)

passed := securityHeader.Signature == actualSignature
/*passed := securityHeader.Signature == actualSignature
if !passed {
logx.Infof("signature different, expect: %s, actual: %s",
securityHeader.Signature, actualSignature)
}
if passed {
return httpx.CodeSignaturePass
}*/
if securityHeader.Signature == actualSignature {
return httpx.CodeSignaturePass
}
logx.Infof("signature different, expect: %s, actual: %s",
securityHeader.Signature, actualSignature)

return httpx.CodeSignatureInvalidToken
}
Expand Down

0 comments on commit d5e4933

Please sign in to comment.