Cover oversized suffix range clamping semantics

Co-authored-by: Theo Browne <[email protected]>
This commit is contained in:
Cursor AgentandTheo Browne committed 2026-02-10 04:39:12 +00:00
1 parent fb6a083b5b
commit 8a424f2c03
1 file changed
+7
+7
View File
@@ -956,6 +956,13 @@ describe("parseByteRangeHeader", () => {
});
});
it("clamps oversized suffix ranges to full file", () => {
expect(parseByteRangeHeader("bytes=-500", 100)).toEqual({
start: 0,
end: 99,
});
});
it("clamps explicit range ends to file size", () => {
expect(parseByteRangeHeader("bytes=90-1000", 100)).toEqual({
start: 90,