caddyhttp: let dotted dynamic placeholders fall through#7766
caddyhttp: let dotted dynamic placeholders fall through#7766puneetdixit200 wants to merge 4 commits into
Conversation
|
I do not think this really fixes #7373. The underlying issue is that custom replacer providers cannot reliably compose with dynamic HTTP placeholders because That means it works for a suffix style like I think this needs a clearer extension mechanism rather than using |
Add a MapFirst hook so custom replacer providers can opt into running before built-in request placeholders instead of relying on dotted header or query names falling through. Assisted-by: OpenAI GPT-5
|
Thanks but I am closing this PR. The CLA is still unsigned, you did not address my concerns and the updated patch still does not address the core issue in #7373. Adding I will not merge a broad core replacer API change as a partial fix here. Please do not attempt to reopen this PR. If you want to continue working on #7373, please discuss the intended design in the issue first so we can agree on the approach before another implementation. |
Fixes #7373
Summary
Replacer.MapFirstso modules can explicitly register a custom replacement provider before existing providers.Tests
GOMODCACHE=/tmp/codex-caddy-gomodcache GOCACHE=/tmp/codex-caddy-gocache go test . -run TestReplacerMapFirst -count=1GOMODCACHE=/tmp/codex-caddy-gomodcache GOCACHE=/tmp/codex-caddy-gocache go test ./modules/caddyhttp -run 'TestHTTPVarReplacement|TestHTTPVarReplacementCustomProviderPrecedence' -count=1\n-GOMODCACHE=/tmp/codex-caddy-gomodcache GOCACHE=/tmp/codex-caddy-gocache go test ./modules/caddyhttp -count=1\n-git diff --check\n\n## Assistance Disclosure\nAI/LLM assistance from OpenAI GPT-5 was used for implementation and test workflow support. I reviewed, authored, and verified the submitted changes.