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/matchers_test.go | |
parent | b84cb058484e7900d60324da1289d319c77f5447 (diff) | |
download | caddy-65195a726d9ceff4bbf870b7baa7eff20cf35381.tar.gz caddy-65195a726d9ceff4bbf870b7baa7eff20cf35381.zip |
Implement rewrite middleware; fix middleware stack bugs
Diffstat (limited to 'modules/caddyhttp/matchers_test.go')
-rw-r--r-- | modules/caddyhttp/matchers_test.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/caddyhttp/matchers_test.go b/modules/caddyhttp/matchers_test.go index c279bad9f..c4c7845b6 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 { |