mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 13:21:37 +00:00
Merge 0b47962017 into 7c9032dff6
This commit is contained in:
commit
60f45d6da4
1 changed files with 1 additions and 1 deletions
|
|
@ -47,7 +47,7 @@ func (handler *jwtHandler) ServeHTTP(out http.ResponseWriter, r *http.Request) {
|
||||||
strToken string
|
strToken string
|
||||||
claims jwt.RegisteredClaims
|
claims jwt.RegisteredClaims
|
||||||
)
|
)
|
||||||
if auth := r.Header.Get("Authorization"); strings.HasPrefix(auth, "Bearer ") {
|
if auth := r.Header.Get("Authorization"); len(auth) >= 7 && strings.EqualFold(auth[:7], "bearer ") {
|
||||||
strToken = strings.TrimPrefix(auth, "Bearer ")
|
strToken = strings.TrimPrefix(auth, "Bearer ")
|
||||||
}
|
}
|
||||||
if len(strToken) == 0 {
|
if len(strToken) == 0 {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue