Repository navigation
Found a bug in file.js gcloud storage #415
Description
Activity
- addedtype: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.api: storageIssues related to the Cloud Storage API.Issues related to the Cloud Storage API.
on Feb 27, 2015 Yeah, looks like that gets the last x bytes, where I thought 0 was implied. We can just fix the bug and call it done, though I would rather default to 0 if not specified. We would shut out the ability for a user to read the tail bytes, but maybe we can come up with another way to do that.
I think it's understandable once you get past that initial assumption. Range requests are a little out of the ordinary anyway, so giving the users flexibility here is probably better and worth the couple extra sentences of documentation to describe the different cases. No reason to overcomplicate with "another way" when this way works just fine with a sprinkle of documentation. :)
I've changed my mind on this considering the terminology we are using
startandend. I've updated the PR to reflect this. You'll no longer be able to "tail" the objects contents using just the end value. We'll have to find a way to support this functionality in the future.- added🚨This issue needs some love.This issue needs some love.triage meI really want to be triaged.I really want to be triaged.
on Apr 6, 2020 - added a commit that references this issue
on Oct 12, 2022 15 remaining items
- added 5 commits that reference this issue
on Jan 27, 2026 - added a commit that references this issue
on Feb 25, 2026 - added a commit that references this issue
on Mar 5, 2026 - added a commit that references this issue
on Mar 5, 2026 - added a commit that references this issue
on Mar 12, 2026 - added a commit that references this issue
on Mar 27, 2026 - added a commit that references this issue
on May 5, 2026
I found a bug in file.js at line 318
Range: 'bytes=' + [options.start || '', options.end || ''].join('-')
If I I use a read stream with start and end, it wont work if start = 0
aFile.createReadStream({start: 0, end: 123}).pipe(res);
Here the header Range will be set to "bytes:-123" but google storage will return nothing, the header should be set to "bytes:0-123" to get valid data from gcloud storage.
Make sure you set nothing in the header Range only if options.start is UNDEFINED but not if it is equal to 0