use errors.Is for extractor errors (#141)

This commit is contained in:
Stefan Tudose 2021-12-15 12:50:05 +01:00 committed by GitHub
parent c435f38291
commit 0fb40d3824
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -58,7 +58,7 @@ func (e MultiExtractor) ExtractToken(req *http.Request) (string, error) {
for _, extractor := range e { for _, extractor := range e {
if tok, err := extractor.ExtractToken(req); tok != "" { if tok, err := extractor.ExtractToken(req); tok != "" {
return tok, nil return tok, nil
} else if err != ErrNoTokenInRequest { } else if !errors.Is(err, ErrNoTokenInRequest) {
return "", err return "", err
} }
} }