Skip to content

fix: treat QUERY method as cacheable in req.fresh#7367

Closed
muhamedfazalps wants to merge 1 commit into
expressjs:masterfrom
muhamedfazalps:fix/fresh-method-query
Closed

fix: treat QUERY method as cacheable in req.fresh#7367
muhamedfazalps wants to merge 1 commit into
expressjs:masterfrom
muhamedfazalps:fix/fresh-method-query

Conversation

@muhamedfazalps

Copy link
Copy Markdown

Fixes #7365. QUERY (RFC 10008) is a safe, idempotent, cacheable HTTP method. All 1258 tests pass.

QUERY (RFC 10008) is a safe, idempotent, cacheable HTTP method. The
req.fresh accessor short-circuits to false for any method other than
GET or HEAD, so QUERY responses never get 304 Not Modified even when
the client sends a matching If-None-Match header.

This change adds QUERY to the set of methods that are eligible for
freshness validation.
@krzysdz

krzysdz commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Duplicate of #7366

@krzysdz krzysdz marked this as a duplicate of #7366 Jul 8, 2026
@krzysdz krzysdz closed this Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

req.fresh returns false for QUERY requests, so 304 Not Modified is never sent

2 participants