fix: address review feedback — stale error message and * wildcard

- assets.ts: change "Image exceeds" to "File exceeds" in size-limit error
- attachment-types.ts: handle plain "*" as allow-all wildcard pattern
- Add test for "*" wildcard (12 tests total)
This commit is contained in:
Subhendu Kundu
2026-03-10 20:01:08 +05:30
parent 3ff07c23d2
commit 1959badde7
3 changed files with 10 additions and 1 deletions

View File

@@ -86,4 +86,12 @@ describe("matchesContentType", () => {
expect(matchesContentType("text/csv", patterns)).toBe(true);
expect(matchesContentType("application/zip", patterns)).toBe(false);
});
it("handles plain * as allow-all wildcard", () => {
const patterns = ["*"];
expect(matchesContentType("image/png", patterns)).toBe(true);
expect(matchesContentType("application/pdf", patterns)).toBe(true);
expect(matchesContentType("text/plain", patterns)).toBe(true);
expect(matchesContentType("application/zip", patterns)).toBe(true);
});
});