mirror of
https://github.com/caddyserver/caddy.git
synced 2026-05-21 06:16:31 -04:00
Request placeholders: extract query argument (#1478)
* feat(request placeholders): adds {?arg}
* test(request placeholders): test query argument extractor {?arg}
This commit is contained in:
@@ -207,6 +207,12 @@ func (r *replacer) getSubstitution(key string) string {
|
||||
return cookie.Value
|
||||
}
|
||||
}
|
||||
// next check for query argument
|
||||
if key[1] == '?' {
|
||||
query := r.request.URL.Query()
|
||||
name := key[2 : len(key)-1]
|
||||
return query.Get(name)
|
||||
}
|
||||
|
||||
// search default replacements in the end
|
||||
switch key {
|
||||
|
||||
Reference in New Issue
Block a user