Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

S3 HeadObject ignores conditional request headers

Open
#1,607 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@RaphaelFakhri is already working on this.

Since Oct 25, 2026.

  • #1608 by @RaphaelFakhri — open

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
Domain
api, backend

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

  1. Upload file.txt to a bucket through the S3 endpoint and note its ETag.
  2. Send HEAD /storage/v1/s3/<bucket>/file.txt with If-None-Match: "<etag>".
  3. 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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from supabase/storage

All issues in supabase/storage

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.