Skip to content

Commit 3edb56f

Browse files
committed
Fix requests with range header.
1 parent 3848bff commit 3edb56f

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

changes.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- fixed: a callback reference in `OPERATION()`
1010
- fixed: cache after route is removed
1111
- fixed: `409` system route
12+
- fixed: requests with `range` header and bad values
1213

1314
======= 2.9.2
1415

index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15640,9 +15640,14 @@ function fsStreamRead(filename, options, callback, req, res) {
1564015640
var opt;
1564115641

1564215642
if (options) {
15643+
1564315644
opt = HEADERS.fsStreamReadRange;
1564415645
opt.start = options.start;
1564515646
opt.end = options.end;
15647+
15648+
if (opt.start > opt.end)
15649+
delete opt.end;
15650+
1564615651
} else
1564715652
opt = HEADERS.fsStreamRead;
1564815653

0 commit comments

Comments
 (0)