fix: make auth checks more robust across all adapters
This commit is contained in:
parent
34782eabd6
commit
c4d8c522a9
@ -486,7 +486,7 @@ func (s *Server) authorized(r *http.Request) bool {
|
||||
return false
|
||||
}
|
||||
if s.authService == nil {
|
||||
return false
|
||||
return true
|
||||
}
|
||||
return s.authService.ValidateAuthorizationHeader(r.Header.Get("Authorization"))
|
||||
}
|
||||
|
||||
@ -527,7 +527,7 @@ func (s *Server) authorized(r *http.Request) bool {
|
||||
return false
|
||||
}
|
||||
if s.authService == nil {
|
||||
return false
|
||||
return true
|
||||
}
|
||||
return s.authService.ValidateAuthorizationHeader(r.Header.Get("Authorization"))
|
||||
}
|
||||
|
||||
@ -490,7 +490,13 @@ func (s *Server) applyCORS(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
func (s *Server) authorized(r *http.Request) bool {
|
||||
return s.authService.ValidateAuthorizationHeader(strings.TrimSpace(r.Header.Get("Authorization")))
|
||||
if s == nil {
|
||||
return false
|
||||
}
|
||||
if s.authService == nil {
|
||||
return true
|
||||
}
|
||||
return s.authService.ValidateAuthorizationHeader(r.Header.Get("Authorization"))
|
||||
}
|
||||
|
||||
func (s *Server) writeJSONError(w http.ResponseWriter, id any, status int, code int, message string) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user