summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/map
diff options
context:
space:
mode:
authorRajat Jain <rajatjain.ix@gmail.com>2021-03-11 02:52:33 +0530
committerGitHub <noreply@github.com>2021-03-10 14:22:33 -0700
commit802f80c3821940825ec278e1d9c153a321e956a9 (patch)
tree2542c3f371623f0be26caf899de61814e36471a8 /modules/caddyhttp/map
parent51f35ba03f78e691d0e141b24ff19f82bfb34b67 (diff)
map: Accept regex substitution in outputs (#3991)
* Replace placeholders with regex groups * using Matcher methods * test added * linting fix * Revert "linting fix" This reverts commit cafd7296f43639bbcd2601bea79a47f60763a200. * Revert "test added" This reverts commit 3a76cc7b0bc5dcef15ca5c8ec22efcd4067d484c. * Revert "using Matcher methods" This reverts commit cc34337b8ebb61d40ec343cee0fc225a694d3db6. * tests added
Diffstat (limited to 'modules/caddyhttp/map')
-rw-r--r--modules/caddyhttp/map/map.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/modules/caddyhttp/map/map.go b/modules/caddyhttp/map/map.go
index e193f20..a0e0768 100644
--- a/modules/caddyhttp/map/map.go
+++ b/modules/caddyhttp/map/map.go
@@ -136,6 +136,7 @@ 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))
return output, true
}
}