Skip to content

Commit

Permalink
Fix: remove slash prefix when comparing with match pattern (#897)
Browse files Browse the repository at this point in the history
Signed-off-by: Daishan Peng <[email protected]>
  • Loading branch information
StrongMonkey authored Dec 18, 2024
1 parent f6d14a7 commit 6bff2e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/controller/handlers/knowledgefile/knowledgefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down

0 comments on commit 6bff2e0

Please sign in to comment.