If-Match Not Implemented for GET #804
Labels
No Label
AdminAPI
Bug
Check AWS
CI
Correctness
Critical
Documentation
Ideas
Improvement
Low priority
Newcomer
Performance
S3 Compatibility
Testing
Usability
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Deuxfleurs/garage#804
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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.