Skip to content

fix: correct ETag comparison (#3193) and HEAD route precedence (#3182)#3206

Open
naarob wants to merge 1 commit into
Kludex:mainfrom
naarob:main
Open

fix: correct ETag comparison (#3193) and HEAD route precedence (#3182)#3206
naarob wants to merge 1 commit into
Kludex:mainfrom
naarob:main

Conversation

@naarob
Copy link
Copy Markdown

@naarob naarob commented Mar 26, 2026

Fixes #3193 and #3182. See commit message for details.

…D route precedence (Kludex#3182)

fix Kludex#3193: staticfiles.is_not_modified() used tag.strip(' W/') which operates
on a character set, incorrectly trimming ETags ending in 'W' or '/'. Replaced
with a normalize_etag() helper that uses str.startswith('W/') for prefix removal.

fix Kludex#3182: Route.__init__ adds HEAD implicitly when GET is defined, causing the
GET route to steal HEAD requests before any explicit HEAD route can match.
Tracked _explicit_methods and return Match.PARTIAL for implicit HEAD so explicit
HEAD routes registered at the same path can take precedence.
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.

2 participants