Repository navigation
caddyhttp: lower-case path patterns with placeholders at request time - #8343
Merged
steadytao merged 2 commits intoNov 4, 2026
Merged
Conversation
Patterns with placeholders were lower-cased at provisioning, which
changed case-sensitive placeholder names such as {env.FOO}, while the
replaced values were never lower-cased and so could not match the
lower-cased request path. Leave such patterns untouched at provisioning
and lower-case the expanded pattern at request time.
Fixes caddyserver#6387
steadytao
requested changes
Nov 3, 2026
steadytao
approved these changes
Nov 4, 2026
francislavoie
pushed a commit
that referenced
this pull request
Nov 5, 2026
…#8343) * caddyhttp: lower-case path patterns with placeholders at request time Patterns with placeholders were lower-cased at provisioning, which changed case-sensitive placeholder names such as {env.FOO}, while the replaced values were never lower-cased and so could not match the lower-cased request path. Leave such patterns untouched at provisioning and lower-case the expanded pattern at request time. Fixes #6387 * caddyhttp: restore the encoded separator path matcher tests (cherry picked from commit 2147da7)
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6387. Follow-up to #8319, reworked as suggested by @steadytao: no placeholder parser anymore.
Path patterns that contain placeholders are left untouched at provisioning, and the expanded pattern is lower-cased at request time. Static patterns are still lower-cased once at provisioning, so they cost nothing more per request.
Before,
{env.FOO}was looked up asenv.foo, and values such as{vars.cycle}=2024-MAR-21could never match the lower-cased request path.Assistance Disclosure
The bug was found during a code review done with Claude Code (Anthropic), which also drafted the fix and the tests. I reviewed the change, can explain every line, and ran
go test -race -shorton the affected package before opening this PR.