[GH-ISSUE #263] One-too-many bytes returned when supplying a range header #54

Closed
opened 2026-03-03 12:07:48 +03:00 by kerem · 0 comments
Owner

Originally created by @gh2k on GitHub (Jun 3, 2020).
Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/263

I think this was introduced by #255 (cc @chowey)

When calling fake-gcs from my tests, I am receiving one more byte than expected. This was working in version 1.18.4.

For example, I have a range header that sets bytes=0-8 and it receives 10 bytes back...

        it('should be able to get back the first 9 bytes of the file', async function() {
          const options = {
            uri: fileUrl,
            headers: {
              Range: 'bytes=0-8'
            }
          }
          const res = await rp.get(options)
          expect(res.body).to.equal('hello wor')
        })

yields an error because the client receives hello worl.

Originally created by @gh2k on GitHub (Jun 3, 2020). Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/263 I think this was introduced by #255 (cc @chowey) When calling fake-gcs from my tests, I am receiving one more byte than expected. This was working in version `1.18.4`. For example, I have a range header that sets `bytes=0-8` and it receives 10 bytes back... ```JavaScript it('should be able to get back the first 9 bytes of the file', async function() { const options = { uri: fileUrl, headers: { Range: 'bytes=0-8' } } const res = await rp.get(options) expect(res.body).to.equal('hello wor') }) ``` yields an error because the client receives `hello worl`.
kerem 2026-03-03 12:07:48 +03:00
  • closed this issue
  • added the
    question
    label
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/fake-gcs-server#54
No description provided.