chore: accept bearer prefix in auth header

This commit is contained in:
Ferdinand Mütsch 2021-02-12 18:12:46 +01:00
parent 22fbfceca2
commit 59b85863cc
1 changed files with 1 additions and 1 deletions

View File

@ -36,7 +36,7 @@ func ExtractBasicAuth(r *http.Request) (username, password string, err error) {
func ExtractBearerAuth(r *http.Request) (key string, err error) {
authHeader := strings.Split(r.Header.Get("Authorization"), " ")
if len(authHeader) != 2 || authHeader[0] != "Basic" {
if len(authHeader) != 2 || (authHeader[0] != "Basic" && authHeader[0] != "Bearer") {
return key, errors.New("failed to extract API key")
}