Skip to content

Commit

Permalink
use StringToBytes func (#2798)
Browse files Browse the repository at this point in the history
  • Loading branch information
lancoLiu committed Apr 23, 2022
1 parent c706ace commit d8e053d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion auth.go
Expand Up @@ -31,7 +31,7 @@ func (a authPairs) searchCredential(authValue string) (string, bool) {
return "", false
}
for _, pair := range a {
if subtle.ConstantTimeCompare([]byte(pair.value), []byte(authValue)) == 1 {
if subtle.ConstantTimeCompare(bytesconv.StringToBytes(pair.value), bytesconv.StringToBytes(authValue)) == 1 {
return pair.user, true
}
}
Expand Down

0 comments on commit d8e053d

Please sign in to comment.