summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/matchers_test.go
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2020-03-16 16:08:33 -0600
committerMatthew Holt <mholt@users.noreply.github.com>2020-03-16 16:08:33 -0600
commitb62f8e058270aff37621b69a9768235a01e8bd34 (patch)
treed51ae6c3c67134fd55852212ca024a0815a64853 /modules/caddyhttp/matchers_test.go
parentae86f6dd91b471067082a48d14d94b868e07474c (diff)
caddyhttp: Support path matcher of "*" without panic
Diffstat (limited to 'modules/caddyhttp/matchers_test.go')
-rw-r--r--modules/caddyhttp/matchers_test.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/modules/caddyhttp/matchers_test.go b/modules/caddyhttp/matchers_test.go
index 3b5afd2..1e50776 100644
--- a/modules/caddyhttp/matchers_test.go
+++ b/modules/caddyhttp/matchers_test.go
@@ -252,6 +252,26 @@ func TestPathMatcher(t *testing.T) {
input: "/foo/BAR.txt",
expect: true,
},
+ {
+ match: MatchPath{"*"},
+ input: "/",
+ expect: true,
+ },
+ {
+ match: MatchPath{"*"},
+ input: "/foo/bar",
+ expect: true,
+ },
+ {
+ match: MatchPath{"**"},
+ input: "/",
+ expect: true,
+ },
+ {
+ match: MatchPath{"**"},
+ input: "/foo/bar",
+ expect: true,
+ },
} {
req := &http.Request{URL: &url.URL{Path: tc.input}}
repl := caddy.NewReplacer()