Support for placeholders in fastcgi env vars.

This commit is contained in:
Abiola Ibrahim
2016-06-29 13:41:52 +01:00
parent 2e84fe4504
commit b1cd0bfeff
4 changed files with 67 additions and 21 deletions
+5
View File
@@ -127,6 +127,11 @@ func NewReplacer(r *http.Request, rr *ResponseRecorder, emptyValue string) Repla
// Replace performs a replacement of values on s and returns
// the string with the replaced values.
func (r *replacer) Replace(s string) string {
// Do not attempt replacements if no placeholder is found.
if !strings.ContainsAny(s, "{}") {
return s
}
// Make response placeholders now
if r.responseRecorder != nil {
r.replacements["{status}"] = strconv.Itoa(r.responseRecorder.status)