From 5bae0238de3edb572a146a4ad05b1f4066627e93 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Wed, 11 Nov 2015 17:46:56 -0700 Subject: [PATCH] Update thermokarst/jwt --- Godeps/Godeps.json | 2 +- .../_workspace/src/github.com/thermokarst/jwt/jwt.go | 10 ++-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index af532c1..fec937d 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -51,7 +51,7 @@ }, { "ImportPath": "github.com/thermokarst/jwt", - "Rev": "6b69668616b8d8598fddf36b4bb4e4e3acb56008" + "Rev": "ce0235af93669b32c6ba1b7cde9f3632b76a6c91" }, { "ImportPath": "golang.org/x/crypto/bcrypt", diff --git a/Godeps/_workspace/src/github.com/thermokarst/jwt/jwt.go b/Godeps/_workspace/src/github.com/thermokarst/jwt/jwt.go index 8370c08..cd7aa7b 100644 --- a/Godeps/_workspace/src/github.com/thermokarst/jwt/jwt.go +++ b/Godeps/_workspace/src/github.com/thermokarst/jwt/jwt.go @@ -11,7 +11,6 @@ import ( "fmt" "log" "net/http" - "net/url" "strings" ) @@ -103,15 +102,10 @@ func (m *Middleware) Secure(h http.Handler, v VerifyClaimsFunc) http.Handler { authHeader := r.Header.Get("Authorization") if authHeader == "" { - queryParam := r.FormValue("token") - if queryParam == "" { + token = r.FormValue("token") + if token == "" { return &jwtError{status: http.StatusUnauthorized, err: ErrMissingToken} } - var err error - token, err = url.QueryUnescape(queryParam) - if err != nil { - return &jwtError{status: http.StatusUnauthorized, err: ErrMalformedToken} - } } else { token = strings.Split(authHeader, " ")[1] }