diff --git a/pkg/controller/handlers/knowledgefile/knowledgefile.go b/pkg/controller/handlers/knowledgefile/knowledgefile.go index 7eb218d2..a58b8246 100644 --- a/pkg/controller/handlers/knowledgefile/knowledgefile.go +++ b/pkg/controller/handlers/knowledgefile/knowledgefile.go @@ -404,7 +404,7 @@ func (h *Handler) Cleanup(req router.Request, _ router.Response) error { func isFileMatchPrefixPattern(filePath string, patterns []string) bool { for _, pattern := range patterns { - if strings.HasPrefix(filePath, pattern) { + if strings.HasPrefix(strings.TrimPrefix(filePath, "/"), pattern) { return true } }