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.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/caddyhttp/map/map.go b/modules/caddyhttp/map/map.go
index a0e0768..670a55b 100644
--- a/modules/caddyhttp/map/map.go
+++ b/modules/caddyhttp/map/map.go
@@ -136,7 +136,11 @@ func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhtt
if output := m.Outputs[destIdx]; output == nil {
continue
} else {
- output = m.re.ReplaceAllString(input, m.Outputs[destIdx].(string))
+ var result []byte
+ for _, submatches := range m.re.FindAllStringSubmatchIndex(input, -1) {
+ result = m.re.ExpandString(result, m.Outputs[destIdx].(string), input, submatches)
+ }
+ output = string(result)
return output, true
}
}