summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/matchers_test.go
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2019-05-20 23:48:43 -0600
committerMatthew Holt <mholt@users.noreply.github.com>2019-05-20 23:48:43 -0600
commit65195a726d9ceff4bbf870b7baa7eff20cf35381 (patch)
tree6b6f19517e4874831197b535395cdc891d11dfbd /modules/caddyhttp/matchers_test.go
parentb84cb058484e7900d60324da1289d319c77f5447 (diff)
Implement rewrite middleware; fix middleware stack bugs
Diffstat (limited to 'modules/caddyhttp/matchers_test.go')
-rw-r--r--modules/caddyhttp/matchers_test.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/caddyhttp/matchers_test.go b/modules/caddyhttp/matchers_test.go
index c279bad..c4c7845 100644
--- a/modules/caddyhttp/matchers_test.go
+++ b/modules/caddyhttp/matchers_test.go
@@ -227,9 +227,10 @@ func TestPathREMatcher(t *testing.T) {
// set up the fake request and its Replacer
req := &http.Request{URL: &url.URL{Path: tc.input}}
- repl := newReplacer(req, httptest.NewRecorder())
+ repl := caddy2.NewReplacer()
ctx := context.WithValue(req.Context(), caddy2.ReplacerCtxKey, repl)
req = req.WithContext(ctx)
+ addHTTPVarsToReplacer(repl, req, httptest.NewRecorder())
actual := tc.match.Match(req)
if actual != tc.expect {
@@ -344,9 +345,10 @@ func TestHeaderREMatcher(t *testing.T) {
// set up the fake request and its Replacer
req := &http.Request{Header: tc.input, URL: new(url.URL)}
- repl := newReplacer(req, httptest.NewRecorder())
+ repl := caddy2.NewReplacer()
ctx := context.WithValue(req.Context(), caddy2.ReplacerCtxKey, repl)
req = req.WithContext(ctx)
+ addHTTPVarsToReplacer(repl, req, httptest.NewRecorder())
actual := tc.match.Match(req)
if actual != tc.expect {