mirror of
https://github.com/fsouza/fake-gcs-server.git
synced 2026-04-26 22:25:50 +03:00
[GH-ISSUE #536] Add support for negative offset #101
Labels
No labels
bug
compatibility-issue
docker
documentation
enhancement
help wanted
needs information
pull-request
question
stale
unfortunate
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/fake-gcs-server#101
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Leavrth on GitHub (Jul 15, 2021).
Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/536
It seems that negative offset is not considered, such as
range=-10-which meansNewRangeReader(ctx, -10, -1).github.com/fsouza/fake-gcs-server@5a7dc5a5a6/fakestorage/object.go (L578-L599)It can be seen in
Example(LastNBytes)in https://pkg.go.dev/cloud.google.com/go/storage#ObjectHandle.NewRangeReader@dnerdy commented on GitHub (Jun 1, 2022):
I'd like to fix this. Note that I don't believe
Range: bytes=-10-is a valid range. A range with an offset from the end of the content looks likeRange: bytes=-10. I also noticed it's possible to cause fake-gcs-server to panic by requesting an out-of-bound range. GCS returns a 416 when the range start is past the end of the content, and ignores other invalid ranges (i.e. it returns a 200 response with the entire content).