Skip to content

Commit

Permalink
Clean unnecessary error check in getSecretToVerifySignature (#5645)
Browse files Browse the repository at this point in the history
  • Loading branch information
furkansenharputlu authored Oct 19, 2023
1 parent 450b20b commit 0078db1
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions gateway/mw_jwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,7 @@ func (k *JWTMiddleware) getSecretToVerifySignature(r *http.Request, token *jwt.T

// Is decoded url too?
if httpScheme.MatchString(string(decodedCert)) {
secret, err := k.getSecretFromURL(string(decodedCert), token.Header[KID], k.Spec.JWTSigningMethod)
if err != nil {
return nil, err
}

return secret, nil
return k.getSecretFromURL(string(decodedCert), token.Header[KID], k.Spec.JWTSigningMethod)
}

return decodedCert, nil // Returns the decoded secret
Expand Down

0 comments on commit 0078db1

Please sign in to comment.