diff options
author | Matthew Holt <[email protected]> | 2019-05-20 23:48:43 -0600 |
---|---|---|
committer | Matthew Holt <[email protected]> | 2019-05-20 23:48:43 -0600 |
commit | 65195a726d9ceff4bbf870b7baa7eff20cf35381 (patch) | |
tree | 6b6f19517e4874831197b535395cdc891d11dfbd /modules/caddyhttp/replacer.go | |
parent | b84cb058484e7900d60324da1289d319c77f5447 (diff) | |
download | caddy-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.go | 6 |
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 } |