From 7c7ef8d40e3af35444d522debc95451c04666615 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Fri, 29 Nov 2019 11:23:49 -0700 Subject: http: Shorten regexp matcher placeholders; allow "=/" for simple matcher --- caddyconfig/httpcaddyfile/httptype.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'caddyconfig/httpcaddyfile') diff --git a/caddyconfig/httpcaddyfile/httptype.go b/caddyconfig/httpcaddyfile/httptype.go index 05022d1..6ea32a2 100644 --- a/caddyconfig/httpcaddyfile/httptype.go +++ b/caddyconfig/httpcaddyfile/httptype.go @@ -477,7 +477,7 @@ func matcherSetFromMatcherToken( if tkn.Text == "*" { // match all requests == no matchers, so nothing to do return nil, true, nil - } else if strings.HasPrefix(tkn.Text, "/") { + } else if strings.HasPrefix(tkn.Text, "/") || strings.HasPrefix(tkn.Text, "=/") { // convenient way to specify a single path match return map[string]json.RawMessage{ "path": caddyconfig.JSON(caddyhttp.MatchPath{tkn.Text}, warnings), -- cgit v1.2.3