Skip to content

caddyhttp: keep placeholder names intact in path matcher - #8319

Closed
BenMacha wants to merge 1 commit into
caddyserver:masterfrom
BenMacha:fix-path-matcher-placeholder-case
Closed

BenMacha wants to merge 1 commit into
caddyserver:masterfrom
BenMacha:fix-path-matcher-placeholder-case

Conversation

@BenMacha

@BenMacha BenMacha commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

MatchPath lower-cased whole patterns at provisioning, so {env.FOO} looked
up env.foo, while placeholder values were never lower-cased and so could not
match the lower-cased request path. Lower-case only outside placeholders, and
lower-case the pattern after replacement.

Assistance Disclosure

The bug was found during a code review done with Claude Code (Anthropic), which also drafted the fix and the test. I reviewed the change, can explain every line, and ran go test -race -short on the affected package before opening this PR.

MatchPath lower-cased whole patterns at provisioning, so {env.FOO} looked
up env.foo, while placeholder values were never lower-cased and so could not
match the lower-cased request path. Lower-case only outside placeholders, and
lower-case the pattern after replacement.
@caddy-cla

caddy-cla Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

✅ Contributor License Agreement

All identified contributors have signed the CLA. Thank you!

@steadytao

steadytao commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

This duplicates #6387 and adds another partial placeholder parser for a change that does not need one. Dynamic patterns should be untouched during provisioning and lowercase the expanded result at request time.

@steadytao steadytao closed this Nov 3, 2026
@steadytao steadytao added the not reviewable ⛔ Cost of reviewing outweighs the implementation, this may be due to various reasons label Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

not reviewable ⛔ Cost of reviewing outweighs the implementation, this may be due to various reasons

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants