Expand If-Range helper edge-case coverage

Co-authored-by: Theo Browne <[email protected]>
This commit is contained in:
Cursor AgentandTheo Browne committed 2026-02-10 03:18:47 +00:00
1 parent 13d771a71f
commit 56bb28267d
1 file changed
+6
+6
View File
@@ -1007,6 +1007,12 @@ describe("ifRangeSatisfied", () => {
ifRangeSatisfied("Thu, 01 Jan 2026 11:59:59 GMT", "\"etag\"", Date.parse("2026-01-01T12:00:01.000Z")),
).toBe(false);
});
it("supports array-valued headers and rejects invalid date forms", () => {
const modifiedAt = Date.parse("2026-01-01T12:00:00.000Z");
expect(ifRangeSatisfied(["\"etag\""], "\"etag\"", modifiedAt)).toBe(true);
expect(ifRangeSatisfied("not-a-date", "\"etag\"", modifiedAt)).toBe(false);
});
});
describe("resolveStaticAssetReadTarget", () => {