Skip to content

Commit

Permalink
httpcaddyfile: Switch r. to re.
Browse files Browse the repository at this point in the history
  • Loading branch information
francislavoie committed May 11, 2020
1 parent e0f1bad commit ffc3b89
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion caddyconfig/httpcaddyfile/httptype.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion caddytest/integration/caddyfile_adapt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

0 comments on commit ffc3b89

Please sign in to comment.