unit icon indicating copy to clipboard operation
unit copied to clipboard

Add HTTP Range header support

Open dj1471 opened this issue 2 years ago • 1 comments

Please add support for the HTTP Range header when serving static files, such that a range of bytes can be requested.

Ref RFC 9110: https://datatracker.ietf.org/doc/html/rfc9110#name-range-requests

This allows interrupted downloads to be resumed and allows seeking of media files.

dj1471 avatar Nov 28 '23 10:11 dj1471

Hi @dj1471 this is currenlty not planed as this would require some medium changes to the Unit Router to handle this. Are we talking about files shared using share from Unit directly? In case of applications (PHP, Python, Node) this can be achieved through the application code.

I know - this is FAR AWAY from beeing ideal but I have added something like this using a nodebased express middleware using res.download.

See the test implementation here: https://github.com/expressjs/express/blob/2a00da2067b7017f769c9100205a2a5f267a884b/test/res.download.js#L34C56-L34C57

Let me know if this would help you for now AND I will check in with the team whats needed to add support for accepting ranges.

tippexs avatar Dec 06 '23 15:12 tippexs