summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/map/map.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/caddyhttp/map/map.go')
-rw-r--r--modules/caddyhttp/map/map.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/caddyhttp/map/map.go b/modules/caddyhttp/map/map.go
index 8394955..0a27aab 100644
--- a/modules/caddyhttp/map/map.go
+++ b/modules/caddyhttp/map/map.go
@@ -145,6 +145,10 @@ func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhtt
return string(result), true
}
if input == m.Input {
+ if outputStr, ok := output.(string); ok {
+ // NOTE: if the output has a placeholder that has the same key as the input, this is infinite recursion
+ return repl.ReplaceAll(outputStr, ""), true
+ }
return output, true
}
}