diff options
Diffstat (limited to 'caddytest')
-rw-r--r-- | caddytest/integration/caddyfile_adapt_test.go | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/caddytest/integration/caddyfile_adapt_test.go b/caddytest/integration/caddyfile_adapt_test.go index 98c81da..280e22e 100644 --- a/caddytest/integration/caddyfile_adapt_test.go +++ b/caddytest/integration/caddyfile_adapt_test.go @@ -539,3 +539,49 @@ func TestLogRollDays(t *testing.T) { } }`) } + +func TestShorthandParameterizedPlaceholders(t *testing.T) { + caddytest.AssertAdapt(t, ` + localhost:80 + respond * "{header.content-type} {labels.0} {query.p} {path.0} {re.name.0}" + `, "caddyfile", `{ + "apps": { + "http": { + "servers": { + "srv0": { + "listen": [ + ":80" + ], + "routes": [ + { + "match": [ + { + "host": [ + "localhost" + ] + } + ], + "handle": [ + { + "handler": "subroute", + "routes": [ + { + "handle": [ + { + "body": "{http.request.header.content-type} {http.request.host.labels.0} {http.request.uri.query.p} {http.request.uri.path.0} {http.regexp.name.0}", + "handler": "static_response" + } + ] + } + ] + } + ], + "terminal": true + } + ] + } + } + } + } +}`) +} |