Trim access token in auth header

This commit is contained in:
Andrew Morgan 2018-07-25 15:23:55 +01:00
parent d2ae425752
commit bfdd3794ed

View file

@ -203,7 +203,7 @@ func extractAccessToken(req *http.Request) (string, error) {
if len(parts) != 2 || parts[0] != "Bearer" {
return "", fmt.Errorf("invalid Authorization header")
}
return parts[1], nil
return strings.Trim(parts[1], " "), nil
}
return "", fmt.Errorf("missing access token")