Skip to content

Commit

Permalink
prioritize access_token URL param over Authorization header
Browse files Browse the repository at this point in the history
  • Loading branch information
jcalabro committed May 25, 2022
1 parent e0a20f8 commit 0bb5f1e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions token.go
Expand Up @@ -34,15 +34,15 @@ func tokenAuth(r *http.Request) string {
if ok && (token == "x-oauth-basic" || token == "") {
token = u
}
if token == "" {
token = r.URL.Query().Get("access_token")
}
if token == "" {
parts := strings.Split(r.Header.Get("Authorization"), " ")
if len(parts) > 1 && tokenTypes[strings.ToLower(parts[0])] {
token = parts[1]
}
}
if token == "" {
token = r.URL.Query().Get("access_token")
}
if token == "" {
return ""
}
Expand Down

0 comments on commit 0bb5f1e

Please sign in to comment.