Skip to content

Commit fd40ce5

Browse files
author
Chris Loper
authored
Fix bearer (#28)
* fix: make sure Bearer is first value in Authorization header * chore: version bump
1 parent a815478 commit fd40ce5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

authentication.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func (a *App) AuthenticateRequest(r *http.Request) (string, error) {
2323
// returns the userID (string) on success, error on failure
2424
func (a *App) AuthenticateRequestWithHeader(r *http.Request) (string, error) {
2525
authHeaderFields := strings.Fields(r.Header.Get("Authorization"))
26-
if len(authHeaderFields) != 2 || authHeaderFields[0] == "Bearer" {
26+
if len(authHeaderFields) != 2 || authHeaderFields[0] != "Bearer" {
2727
return "", Error{Message: "missing authentication token: expected \"Bearer\" header"}
2828
}
2929

version.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v1.3.1
1+
v1.3.2

0 commit comments

Comments
 (0)