Cover oversized suffix range clamping semantics
Co-authored-by: Theo Browne <[email protected]>
This commit is contained in:
1 parent
fb6a083b5b
commit
8a424f2c03
1 file changed
+7
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user