Skip to content

Conversation

@sampaiodiego
Copy link
Member

Proposed changes (including videos or screenshots)

Issue(s)

Closes #20203
Related to RocketChat/Rocket.Chat.ReactNative#2759

Steps to test or reproduce

Further comments

@sampaiodiego sampaiodiego added this to the 3.14.0 milestone Apr 6, 2021
const range = getFileRange(file, req);
setRangeHeaders(range, file, res);

if (range) {
Copy link
Member

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?

Copy link
Member Author

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')) {
Copy link
Member

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).

@RocketChat RocketChat deleted a comment from lgtm-com bot Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants