expressjs / serve-static

Serve static files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrong behavior when handling discontinuous ranges.

daveying opened this issue · comments

I use serve-static middleware with expressjs to serve a big file, when I request discontinuous partial content of that big file, serve-static will response with the whole file and the status code is 200 rather than 206.
e.g. content of my big file (localhost:5052/test.txt) is:

0123456789

If I request with:

GET /test.txt HTTP/1.1
Host: localhost:5052
Range: bytes=1-3,6-8 // note, discontinuous
Cache-Control: no-cache

The response will be the whole file

0123456789

But if the range is continuous, it works fine.

Please give some advises. Thanks

I realized that this is a problem of send, and I noticed that there is a merge request to solve this problem, please update your send to latest version. Thanks!

The send version used is already the latest version.