aboutsummaryrefslogtreecommitdiffhomepage
path: root/modules/caddyhttp/matchers_test.go
diff options
context:
space:
mode:
authorMatthew Holt <[email protected]>2019-11-29 11:23:49 -0700
committerMatthew Holt <[email protected]>2019-11-29 11:23:49 -0700
commit7c7ef8d40e3af35444d522debc95451c04666615 (patch)
tree30cf3cb2b10e0e19e308eef8031f64bf7739b6bb /modules/caddyhttp/matchers_test.go
parent14d3fd7d0307e69c3c8995c42052b9103d1e2299 (diff)
downloadcaddy-7c7ef8d40e3af35444d522debc95451c04666615.tar.gz
caddy-7c7ef8d40e3af35444d522debc95451c04666615.zip
http: Shorten regexp matcher placeholders; allow "=/" for simple matcher
Diffstat (limited to 'modules/caddyhttp/matchers_test.go')
-rw-r--r--modules/caddyhttp/matchers_test.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/caddyhttp/matchers_test.go b/modules/caddyhttp/matchers_test.go
index 321d3ce7e..9fa7d8e8a 100644
--- a/modules/caddyhttp/matchers_test.go
+++ b/modules/caddyhttp/matchers_test.go
@@ -324,10 +324,10 @@ func TestPathREMatcher(t *testing.T) {
}
for key, expectVal := range tc.expectRepl {
- placeholder := fmt.Sprintf("{http.matchers.path_regexp.%s}", key)
+ placeholder := fmt.Sprintf("{http.regexp.%s}", key)
actualVal := repl.ReplaceAll(placeholder, "<empty>")
if actualVal != expectVal {
- t.Errorf("Test %d [%v]: Expected placeholder {http.matchers.path_regexp.%s} to be '%s' but got '%s'",
+ t.Errorf("Test %d [%v]: Expected placeholder {http.regexp.%s} to be '%s' but got '%s'",
i, tc.match.Pattern, key, expectVal, actualVal)
continue
}
@@ -442,10 +442,10 @@ func TestHeaderREMatcher(t *testing.T) {
}
for key, expectVal := range tc.expectRepl {
- placeholder := fmt.Sprintf("{http.matchers.header_regexp.%s}", key)
+ placeholder := fmt.Sprintf("{http.regexp.%s}", key)
actualVal := repl.ReplaceAll(placeholder, "<empty>")
if actualVal != expectVal {
- t.Errorf("Test %d [%v]: Expected placeholder {http.matchers.header_regexp.%s} to be '%s' but got '%s'",
+ t.Errorf("Test %d [%v]: Expected placeholder {http.regexp.%s} to be '%s' but got '%s'",
i, tc.match, key, expectVal, actualVal)
continue
}