kotx / render

Cloudflare Worker to proxy and cache requests to R2
MIT License
384 stars 85 forks source link

Remove unnecessary head request in range read #3

Closed ben476 closed 2 years ago

ben476 commented 2 years ago

Since R2 will just read the rest of the file without throwing an error if the specified length is greater than the actual file size, these changes should be safe.

kotx commented 2 years ago

Hopefully this doesn't greatly affect how range-parser parses the header (it likely doesn't). Thanks!

kotx commented 2 years ago

Oh I just realized, this will mean there is no pre-filled file when range is specified, so this breaks if-range here... Reverting for now, I'll try to fix it later when I have time Edit: I fixed this here, thanks!