File backend accepts weak If-Match validators as strong matches

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

Maintainers usually reply within 1 day

@hsusul is already working on this.

Since Oct 31, 2026.

  • #1640 by @hsusul — open

Assessment

Difficulty
3/5
Estimated time
Half a day
Newbie friendliness
70/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
backend

Research direction

Start in the FileBackend ETag matcher, the single helper that strips W/ for both If-Match and If-None-Match, and trace the public object GET route that calls it. Reproduce with a file-backend upload, then GET with If-Match: W/"abc", with and without a Range header; the expected result is 412. Done means If-Match uses strong comparison, If-None-Match stays weak, list and wildcard handling still work, and the copy-source precondition path is checked too.

Written by the indexing model from the issue text.

Description

File-backed object downloads accept a weak If-Match validator when its opaque value equals the stored ETag. A public GET returns 200, or 206 with a Range header, instead of 412 Precondition Failed.

Reproduction
  1. Use STORAGE_BACKEND=file and upload an object.
  2. GET its public object URL and read the response ETag, for example "abc".
  3. Repeat the GET with If-Match: W/"abc".
  4. Repeat with both that header and Range: bytes=0-6.

On current master 9d15cdc9, the public-route reproduction returns 200 and 206. A control with If-None-Match: W/"abc" returns the expected 304.

RFC 9110 section 13.1.1 requires strong comparison for If-Match. Section 13.1.2 requires weak comparison for If-None-Match.

FileBackend uses one matcher that strips W/ for both conditions. The same helper evaluates copy-source preconditions. It needs to distinguish strong matching from weak matching while retaining list and wildcard support.

Dominant language
TypeScript
Stars
1.3k
Forks
318
Avg merge
1d 17h
Merged PRs (30d)
101

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.