Request placeholders: extract query argument (#1478)

* feat(request placeholders): adds {?arg}

* test(request placeholders): test query argument extractor {?arg}
This commit is contained in:
Samuel BERTHE
2017-03-03 07:25:28 +01:00
committed by Matt Holt
parent 0a0d2cc1cf
commit 75ccc05d84
2 changed files with 11 additions and 2 deletions
+6
View File
@@ -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 {