Skip to content

Commit

Permalink
Skip validate when auth token is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
songy23 committed Oct 15, 2024
1 parent 7e121ef commit 2964cd5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions comp/otelcol/ddflareextension/impl/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ type server struct {
// validateToken - validates token for legacy API
func validateToken(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if err := util.Validate(w, r); err != nil {
return
if util.GetAuthToken() != "" {
if err := util.Validate(w, r); err != nil {
return
}
}
next.ServeHTTP(w, r)
})
Expand Down

0 comments on commit 2964cd5

Please sign in to comment.