-
Notifications
You must be signed in to change notification settings - Fork 13.1k
[IMPROVE] Add support to range downloads on file system storage #21463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| const range = getFileRange(file, req); | ||
| setRangeHeaders(range, file, res); | ||
|
|
||
| if (range) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The setRangeHeaders takes into consideration if range is out of bounds, but this condition does not. Maybe changing to range && !range.outOfRange?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right.. I'll change to look more how GridFS does.. 👍
| res.setHeader('Content-Length', file.size); | ||
|
|
||
| this.store.getReadStream(file._id, file).pipe(res); | ||
| if (!options.hasOwnProperty('start')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may fail if { start: undefined } (cause the property is there, but with an invalid value).
Proposed changes (including videos or screenshots)
Issue(s)
Closes #20203
Related to RocketChat/Rocket.Chat.ReactNative#2759
Steps to test or reproduce
Further comments