mirror of
https://github.com/fsouza/fake-gcs-server.git
synced 2026-04-25 21:55:56 +03:00
[GH-ISSUE #1076] If-Generation-Match header not handled on object read. #163
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#163
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 @jklipp on GitHub (Feb 16, 2023).
Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/1076
fakestoragedoesn't handlex-goog-if-generation-matchheader thatcloud.google.com/go/storageseems to be sending.I was writing a test using fakestorage as a backend to validate that my system can handle generation mismatches, with code similar to:
when I found that the GenerationMatch condition was being ignored (NewReader returns nil err).
I'm unclear under what condition
cloud.google.com/go/storagesends the header rather than a json blob or form value with agenerationkey in it. I see a reference to it in the GCS XML API, specifically in the download an object call.For now I've worked around this in our own repo by simply checking for the header as well during the downloadObject call:
github.com/inflexiongames/fake-gcs-server@4365cf2a5c. If that seems like a reasonable approach I can look at doing a PR, but wanted to see if I'd overlooked something first.@jklipp commented on GitHub (Feb 16, 2023):
Oh, looking at it some more I may have gone down the wrong path - it looks more like the
generationspecifier is for downloading a particular generation, rather than supporting the precondition.In that case I guess my question is more are preconditions supported for downloads? I see support for preconditions on uploads went in last year https://github.com/fsouza/fake-gcs-server/pull/735 but there may not be support for downloads yet?
@jklipp commented on GitHub (Feb 17, 2023):
I made an attempt at implementing if-generation-match preconditions for get and download in
github.com/inflexiongames/fake-gcs-server@6ed1d78733, does this seem somewhat like a sensible approach?@fsouza commented on GitHub (Feb 25, 2023):
Hey, sorry things have been slow on my end, but I'm planning to take a look at this during this weekend!
@fsouza commented on GitHub (May 3, 2023):
Hey @jklipp, sorry for the ridiculous turnaround on this. I've taken a look at the changes, it seems reasonable, perhaps if we can avoid breaking the library API, it should be perfect. Can you send a PR so we can have CI run on it? And also I can leave some inline comments in the PR.