From 65195a726d9ceff4bbf870b7baa7eff20cf35381 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Mon, 20 May 2019 23:48:43 -0600 Subject: Implement rewrite middleware; fix middleware stack bugs --- modules/caddyhttp/replacer.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'modules/caddyhttp/replacer.go') diff --git a/modules/caddyhttp/replacer.go b/modules/caddyhttp/replacer.go index 6feb143..16cc1fe 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 } -- cgit v1.2.3