diff --git a/comp/otelcol/ddflareextension/impl/server.go b/comp/otelcol/ddflareextension/impl/server.go index 4b3c0fcf0c104..f4eadd14db495 100644 --- a/comp/otelcol/ddflareextension/impl/server.go +++ b/comp/otelcol/ddflareextension/impl/server.go @@ -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) })