Avoid decoding unrelated profiles

This commit is contained in:
2026-08-11 22:32:33 +00:00
parent 70e0ea0cf0
commit 731b66cff5
4 changed files with 161 additions and 10 deletions

View File

@@ -114,13 +114,13 @@ func loadProfile(ctx context.Context, fsys fs.FS, root string, id string) (*doma
}
continue
}
if !idMatch {
continue
}
prof, err := decodeProfile(data)
if err != nil {
if idMatch {
return nil, fmt.Errorf("%w: %s: %v", ErrInvalidYAML, relPath, err)
}
continue
return nil, fmt.Errorf("%w: %s: %v", ErrInvalidYAML, relPath, err)
}
prof.ID = strings.TrimSpace(prof.ID)