Only check when access_token is available
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
a6dde44d56
commit
c232fbc828
|
@ -63,8 +63,10 @@ func WithAuth(handler http.Handler, b *memoryBackend) http.Handler {
|
||||||
|
|
||||||
authorization := ""
|
authorization := ""
|
||||||
|
|
||||||
if r.Method == http.MethodGet && r.URL.Query().Get("action") == "events" {
|
values := r.URL.Query()
|
||||||
authorization = "Bearer " + r.URL.Query().Get("access_token")
|
|
||||||
|
if r.Method == http.MethodGet && values.Get("action") == "events" && values.Get("access_token") != "" {
|
||||||
|
authorization = "Bearer " + values.Get("access_token")
|
||||||
} else {
|
} else {
|
||||||
authorization = r.Header.Get("Authorization")
|
authorization = r.Header.Get("Authorization")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user