mirror of
https://github.com/hoernschen/dendrite.git
synced 2024-12-27 07:28:27 +00:00
Trim access token in auth header
This commit is contained in:
parent
d2ae425752
commit
bfdd3794ed
1 changed files with 1 additions and 1 deletions
|
@ -203,7 +203,7 @@ func extractAccessToken(req *http.Request) (string, error) {
|
||||||
if len(parts) != 2 || parts[0] != "Bearer" {
|
if len(parts) != 2 || parts[0] != "Bearer" {
|
||||||
return "", fmt.Errorf("invalid Authorization header")
|
return "", fmt.Errorf("invalid Authorization header")
|
||||||
}
|
}
|
||||||
return parts[1], nil
|
return strings.Trim(parts[1], " "), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return "", fmt.Errorf("missing access token")
|
return "", fmt.Errorf("missing access token")
|
||||||
|
|
Loading…
Reference in a new issue