diff --git a/validator/rpc/intercepter.go b/validator/rpc/intercepter.go index 12761eff0aeb..17b414a8c10d 100644 --- a/validator/rpc/intercepter.go +++ b/validator/rpc/intercepter.go @@ -38,7 +38,7 @@ func (s *Server) AuthTokenInterceptor() grpc.UnaryServerInterceptor { func (s *Server) AuthTokenHandler(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { // if it's not initialize or has a web prefix - if (strings.Contains(r.URL.Path, api.WebApiUrlPrefix) || strings.Contains(r.URL.Path, api.KeymanagerApiPrefix)) && !strings.Contains(r.URL.Path, api.SystemLogsPrefix) { + if (strings.HasPrefix(r.URL.Path, api.WebApiUrlPrefix) || strings.HasPrefix(r.URL.Path, api.KeymanagerApiPrefix)) && !strings.HasPrefix(r.URL.Path, "/"+api.SystemLogsPrefix) { // ignore some routes reqToken := r.Header.Get("Authorization") if reqToken == "" {