(req *http.Request)
| 55 | type MultiExtractor []Extractor |
| 56 | |
| 57 | func (e MultiExtractor) ExtractToken(req *http.Request) (string, error) { |
| 58 | // loop over header names and return the first one that contains data |
| 59 | for _, extractor := range e { |
| 60 | if tok, err := extractor.ExtractToken(req); tok != "" { |
| 61 | return tok, nil |
| 62 | } else if !errors.Is(err, ErrNoTokenInRequest) { |
| 63 | return "", err |
| 64 | } |
| 65 | } |
| 66 | return "", ErrNoTokenInRequest |
| 67 | } |
| 68 | |
| 69 | // PostExtractionFilter wraps an Extractor in this to post-process the value before it's handed off. |
| 70 | // See AuthorizationHeaderExtractor for an example |
nothing calls this directly
no test coverage detected