From ffc3b893b8c56bda2a795061e5a0531e893f2587 Mon Sep 17 00:00:00 2001 From: Francis Lavoie Date: Mon, 11 May 2020 17:14:54 -0400 Subject: [PATCH] httpcaddyfile: Switch `r.` to `re.` --- caddyconfig/httpcaddyfile/httptype.go | 2 +- caddytest/integration/caddyfile_adapt_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/caddyconfig/httpcaddyfile/httptype.go b/caddyconfig/httpcaddyfile/httptype.go index f59145042dd9..8e1ca74d003e 100644 --- a/caddyconfig/httpcaddyfile/httptype.go +++ b/caddyconfig/httpcaddyfile/httptype.go @@ -109,7 +109,7 @@ func (st ServerType) Setup(inputServerBlocks []caddyfile.ServerBlock, {regexp.MustCompile(`{labels\.([\w-]*)}`), "{http.request.host.labels.$1}"}, {regexp.MustCompile(`{header\.([\w-]*)}`), "{http.request.header.$1}"}, {regexp.MustCompile(`{path\.([\w-]*)}`), "{http.request.uri.path.$1}"}, - {regexp.MustCompile(`{r\.([\w-]*)\.([\w-]*)}`), "{http.regexp.$1.$2}"}, + {regexp.MustCompile(`{re\.([\w-]*)\.([\w-]*)}`), "{http.regexp.$1.$2}"}, } for _, sb := range originalServerBlocks { diff --git a/caddytest/integration/caddyfile_adapt_test.go b/caddytest/integration/caddyfile_adapt_test.go index 432e1690f48a..594331d44a1b 100644 --- a/caddytest/integration/caddyfile_adapt_test.go +++ b/caddytest/integration/caddyfile_adapt_test.go @@ -493,7 +493,7 @@ func TestGlobalOptions(t *testing.T) { func TestShorthandParameterizedPlaceholders(t *testing.T) { caddytest.AssertAdapt(t, ` localhost:80 - respond * "{header.content-type} {labels.0} {query.p} {path.0} {r.name.0}" + respond * "{header.content-type} {labels.0} {query.p} {path.0} {re.name.0}" `, "caddyfile", `{ "apps": { "http": {