Skip to content

fix(http): evaluate cache validators for HEAD requests - #7329

Open
dennisimoo wants to merge 1 commit into
denoland:mainfrom
dennisimoo:codex/conditional-head
Open

dennisimoo wants to merge 1 commit into
denoland:mainfrom
dennisimoo:codex/conditional-head

Conversation

@dennisimoo

Copy link
Copy Markdown

Fixes #7327.

Move the existing HEAD response below cache-validator evaluation, while keeping it before Range handling and file opening. Conditional HEAD requests now return 304 like GET, as required by RFC 9110 §13.2.2.

Tests cover matching ETags, *, modified-since dates, ETag precedence, ignored Range headers and serveDir(). Both regressions fail before the fix.

Tests: deno test -A --doc http/ — 479 passed, 987 steps, 2 ignored. Lint and formatting passed. Full-suite verification is memory-limited: the sibling branch's deno task ok was killed in an unrelated CBOR test allocating 4–8 GiB; this branch's full run was stopped before repeating that allocation.

AI-assisted with Codex.

@CLAassistant

CLAassistant commented Sep 23, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions Bot added the http label Sep 23, 2026
@codecov

codecov Bot commented Sep 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.04%. Comparing base (01fe755) to head (db8bbe0).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7329   +/-   ##
=======================================
  Coverage   95.04%   95.04%           
=======================================
  Files         618      618           
  Lines       51746    51746           
  Branches     9402     9402           
=======================================
  Hits        49181    49181           
  Misses       2022     2022           
  Partials      543      543           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

serveFile() ignores cache validators on HEAD requests

2 participants