If-Match Not Implemented for GET #804
Labels
No labels
action
check-aws
action
discussion-needed
action
for-external-contributors
action
for-newcomers
action
more-info-needed
action
need-funding
action
triage-required
kind
correctness
kind
ideas
kind
improvement
kind
performance
kind
testing
kind
usability
kind
wrong-behavior
prio
critical
prio
low
scope
admin-api
scope
background-healing
scope
build
scope
documentation
scope
k8s
scope
layout
scope
metadata
scope
ops
scope
rpc
scope
s3-api
scope
security
scope
telemetry
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Deuxfleurs/garage#804
Loading…
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?
Scenario: When an If-Match header is passed to Garage on a GET request, as it would be for a Range Request.
(An object is present at path
s3Path
andreq.get('If-Match')
returns an ETag different than the ETag of the existing version.)Steps (using @aws-sdk/client-s3 in an Express server)
Expected Result
await s3client.send(new GetObjectCommand(getParam))
throws a PreconditionFailed error.Actual Result
await s3client.send(new GetObjectCommand(getParam))
returns a ServerResponse with statusCode === 200I'm having a hard time understanding exactly what is the request that your code makes.
Could you rather set your Garage daemon to debug mode (
RUST_LOG=garage_api=debug
) and paste the log lines corresponding to the request and its associated response?Thanks
Note that the last line shows that the ETag of the existing object is "a2ec0c77b7bea23455185bcc75535bf7". The request sends the if-match header with value "6kjl35j6365k", so it doesn't match, and the request should return status 412 Precondition Failed
By itself, If-Match on a GET request is rarely useful, but when making a Range request, it's essential that the range come from the same version of the object.