chose: cancel the assignment and judge later (#1359)

Co-authored-by: charliecen <chq@abierr.com>
master
charliecen 3 years ago committed by GitHub
parent 6f1d27354a
commit d5e493383a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -119,7 +119,7 @@ func VerifySignature(r *http.Request, securityHeader *ContentSecurityHeader, tol
}, "\n") }, "\n")
actualSignature := codec.HmacBase64(securityHeader.Key, signContent) actualSignature := codec.HmacBase64(securityHeader.Key, signContent)
passed := securityHeader.Signature == actualSignature /*passed := securityHeader.Signature == actualSignature
if !passed { if !passed {
logx.Infof("signature different, expect: %s, actual: %s", logx.Infof("signature different, expect: %s, actual: %s",
securityHeader.Signature, actualSignature) securityHeader.Signature, actualSignature)
@ -127,7 +127,12 @@ func VerifySignature(r *http.Request, securityHeader *ContentSecurityHeader, tol
if passed { if passed {
return httpx.CodeSignaturePass return httpx.CodeSignaturePass
}*/
if securityHeader.Signature == actualSignature {
return httpx.CodeSignaturePass
} }
logx.Infof("signature different, expect: %s, actual: %s",
securityHeader.Signature, actualSignature)
return httpx.CodeSignatureInvalidToken return httpx.CodeSignatureInvalidToken
} }

Loading…
Cancel
Save