You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Gap] S3 GET and PUT ignore conditional headers (If-None-Match, If-Match, If-Modified-Since) #171
Conditional request headers are ignored. A GET with a matching If-None-Match returns the full body with 200 instead of 304. S3 supports conditional PUTs, If-None-Match: * for create-only and If-Match: <etag> for compare-and-swap; here both overwrite unconditionally. Clients that rely on them for caching or locking get silent lost updates.
Classification
Type: Edge-Case Gap
Severity: Low
Verification: Verified (Runtime) for GET; Static Audit for PUT and HEAD
s3.get_object(Bucket="demo", Key="stream.bin", IfNoneMatch=etag) returns HTTP 200 with the body. Expected: 304 Not Modified.
put_object and head_object take no HeaderMap, so they never read If-* headers either.
Proposed Fix / Recommendation
The ETag is already a stable capsule ID, so these checks are cheap:
GET and HEAD: If-Match → 412, If-None-Match → 304, and If-Modified-Since / If-Unmodified-Since compared against created_at.
PUT: evaluate If-None-Match: * and If-Match in S3View::put_object, under the pipeline lock and next to the existing live_capsule lookup, so the check and the bind are atomic. Return 412 PreconditionFailed on a mismatch.
Fixed in cdb3249 (#181). GET and HEAD give 412 or 304 per RFC 9110. PUT honours If-None-Match: *, If-Match and If-Unmodified-Since, checked again under the pipeline lock at the commit. A test races two create-only PUTs and only one wins. CHANGELOG updated. This closes when #181 merges.
Activity
saworbit commentedon Nov 13, 2026
Fixed in cdb3249 (#181). GET and HEAD give 412 or 304 per RFC 9110. PUT honours If-None-Match: *, If-Match and If-Unmodified-Since, checked again under the pipeline lock at the commit. A test races two create-only PUTs and only one wins. CHANGELOG updated. This closes when #181 merges.