From bfdd3794edf61533cdec530c5e5a3c0bcbc25de6 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Wed, 25 Jul 2018 15:23:55 +0100 Subject: [PATCH] Trim access token in auth header --- src/github.com/matrix-org/dendrite/clientapi/auth/auth.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/github.com/matrix-org/dendrite/clientapi/auth/auth.go b/src/github.com/matrix-org/dendrite/clientapi/auth/auth.go index 80df0e72..649306eb 100644 --- a/src/github.com/matrix-org/dendrite/clientapi/auth/auth.go +++ b/src/github.com/matrix-org/dendrite/clientapi/auth/auth.go @@ -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")