From a7ee84fc31d597a55e591470aba489b643ce7210 Mon Sep 17 00:00:00 2001 From: Michael Yang Date: Thu, 9 May 2024 11:23:22 -0700 Subject: [PATCH] routes: skip invalid filepaths --- server/routes.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/routes.go b/server/routes.go index 4121483e..c4c0f6a9 100644 --- a/server/routes.go +++ b/server/routes.go @@ -732,6 +732,11 @@ func (s *Server) ListModelsHandler(c *gin.Context) { } n := model.ParseNameFromFilepath(rel) + if !n.IsValid() { + slog.Info("invalid model filepath", "path", rel) + return nil + } + m, err := ParseNamedManifest(n) if err != nil { return err