aboutsummaryrefslogtreecommitdiffhomepage
path: root/modules/caddyhttp/replacer.go
diff options
context:
space:
mode:
authorMatthew Holt <[email protected]>2019-05-20 23:48:43 -0600
committerMatthew Holt <[email protected]>2019-05-20 23:48:43 -0600
commit65195a726d9ceff4bbf870b7baa7eff20cf35381 (patch)
tree6b6f19517e4874831197b535395cdc891d11dfbd /modules/caddyhttp/replacer.go
parentb84cb058484e7900d60324da1289d319c77f5447 (diff)
downloadcaddy-65195a726d9ceff4bbf870b7baa7eff20cf35381.tar.gz
caddy-65195a726d9ceff4bbf870b7baa7eff20cf35381.zip
Implement rewrite middleware; fix middleware stack bugs
Diffstat (limited to 'modules/caddyhttp/replacer.go')
-rw-r--r--modules/caddyhttp/replacer.go6
1 files changed, 1 insertions, 5 deletions
diff --git a/modules/caddyhttp/replacer.go b/modules/caddyhttp/replacer.go
index 6feb1437c..16cc1fe99 100644
--- a/modules/caddyhttp/replacer.go
+++ b/modules/caddyhttp/replacer.go
@@ -13,9 +13,7 @@ import (
// TODO: A simple way to format or escape or encode each value would be nice
// ... TODO: Should we just use templates? :-/ yeesh...
-func newReplacer(req *http.Request, w http.ResponseWriter) caddy2.Replacer {
- repl := caddy2.NewReplacer()
-
+func addHTTPVarsToReplacer(repl caddy2.Replacer, req *http.Request, w http.ResponseWriter) {
httpVars := func() map[string]string {
m := make(map[string]string)
if req != nil {
@@ -78,6 +76,4 @@ func newReplacer(req *http.Request, w http.ResponseWriter) caddy2.Replacer {
}
repl.Map(httpVars)
-
- return repl
}