Skip to content

fix(file): use strong comparison for If-Match - #1640

Open
hsusul wants to merge 2 commits into
supabase:masterfrom
hsusul:fix/file-strong-if-match
Open

hsusul wants to merge 2 commits into
supabase:masterfrom
hsusul:fix/file-strong-if-match

Conversation

@hsusul

@hsusul hsusul commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Why

File-backed downloads return 200 or 206 for a matching weak If-Match validator. RFC 9110 requires strong comparison and a failed precondition for that input.

Fixes #1639.

What changed

  • Require an explicit strong or weak comparison mode in the file-backend ETag matcher.
  • Use strong comparison for read and copy-source If-Match checks.
  • Cover public downloads, ranges, copy rejection, and weak cache validation.

Scope

File-backed read and copy-source preconditions.

Blast Radius

Local and self-hosted clients receive 412 for weak If-Match validators. Regression coverage retains strong matches, lists, wildcards, unquoted-tag compatibility, and weak If-None-Match cache validation.

Verification

  • The regression commit fails six cases on the original implementation. The fixed focused suite passes all 177 tests.
  • The full unit suite passes all 3,426 tests under Node 26.13.0 and npm 12.2.1.
  • npm run build, npm run lint, and git diff --check pass.

Prepared with AI assistance.

@hsusul
hsusul requested a review from a team as a code owner October 31, 2026 18:10
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 41228066049

Coverage increased (+0.004%) to 86.952%

Details

  • Coverage increased (+0.004%) from the base build.
  • Patch coverage: 7 of 7 lines across 1 file are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 15595
Covered Lines: 13998
Line Coverage: 89.76%
Relevant Branches: 9957
Covered Branches: 8220
Branch Coverage: 82.55%
Branches in Coverage %: Yes
Coverage Strength: 1224.56 hits per line

💛 - Coveralls

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

File backend accepts weak If-Match validators as strong matches

2 participants