S3 HeadObject ignores conditional request headers
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- postgresql, typescript
Research direction
Start with src/http/routes/s3/commands/head-object.ts and trace how GetObject passes conditional headers through to S3ProtocolHandler.dbHeadObject. Add the corresponding checks for HeadObject, then find or add tests for matching and failed conditional requests. Done means matching If-None-Match returns 304 and stale If-Match returns 412.
Written by the indexing model from the issue text.
Description
S3 HeadObject ignores If-Match, If-None-Match, If-Modified-Since and If-Unmodified-Since, so it always returns 200. S3 returns 304 for a matching If-None-Match (or If-Modified-Since when nothing changed) and 412 for a failed If-Match (or If-Unmodified-Since). GetObject on this server already does this.
Steps to reproduce
- Upload
file.txtto a bucket through the S3 endpoint and note its ETag. - Send
HEAD /storage/v1/s3/<bucket>/file.txtwithIf-None-Match: "<etag>". - Send the same request with
If-Match: "stale".
Expected
Step 2 returns 304 Not Modified. Step 3 returns 412 Precondition Failed.
Actual
Both return 200 OK.
Cause
The HeadObject route schema (src/http/routes/s3/commands/head-object.ts) declares no headers, so the route never passes the conditional headers on, and S3ProtocolHandler.dbHeadObject never checks them.
- Dominant language
- TypeScript
- Stars
- 1.3k
- Forks
- 314
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 98
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from supabase/storage
-
The sample application in storage article points to wrong URLMay be free again @prasadf18 claimed this 200 days ago, and no pull request is open. Opendocumentation
Difficulty 1/5 Under an hour Newbie friendliness 62/100
supabase/storage#557 · 1 comment ·
Maintainers usually reply within 1 day
-
S3 PutObject ignores Content-MD5 integrity checksPossibly taken @ferhatelmas claimed this 7 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 70/100
supabase/storage#1561 · 1 assignee ·
Maintainers usually reply within 1 day
-
Iceberg tenant table listing ignores pageSize and pageTokenPossibly taken @ferhatelmas claimed this 7 days ago. Open
Difficulty 4/5 1-2 days Newbie friendliness 35/100
supabase/storage#1549 · 1 assignee ·
Maintainers usually reply within 1 day
-
S3 PutObject drops the Expires system metadataPossibly taken @ferhatelmas claimed this 7 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
supabase/storage#1548 · 1 assignee ·
Maintainers usually reply within 1 day
-
TUS S3 stale holder can delete successor leasePossibly taken @hsusul claimed this 10 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 58/100
Maintainers usually reply within 1 day
All issues in supabase/storage
Similar issues
-
[Bug]: Payment providers removed from config are never disabled in payment_providerPossibly taken @medusa-os-bot claimed this today. Opentype: bug
Difficulty 2/5 Half a day Newbie friendliness 82/100
medusajs/medusa#17544 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
software-mansion/argent#1651 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
lane:reliability
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day