mirror of
https://github.com/caddyserver/caddy.git
synced 2026-11-16 13:12:08 +00:00
A "${...}" was only protected from the placeholder replacer when the
current expression defined that group, so "${2}" and "${missing}" came
out as a literal "$" instead of the empty string, and unbraced "$2",
"$missing" and "$1x" stayed literal instead of expanding to the empty
string. All of those are syntactically valid references and
regexp.ExpandString has always resolved them to the empty string.
Decide the overlap of the two syntaxes by syntax alone, not by the
capture groups of one expression: a "${" whose contents can be a
reference name is a reference and its brace is escaped for the replacer;
any other "${" is a literal dollar followed by a Caddy placeholder, so
"${http.request.method}" still expands to "$GET". Everything else is
passed through untouched for ExpandString.
Adds regressions for $2, $missing, ${2}, ${missing} and $1x.
|
||
|---|---|---|
| .. | ||
| caddyevents | ||
| caddyfs | ||
| caddyhttp | ||
| caddypki | ||
| caddytls | ||
| filestorage | ||
| internal/network | ||
| logging | ||
| metrics | ||
| standard | ||