From afca2421112eb89e435888f50f8146364a3c60a4 Mon Sep 17 00:00:00 2001 From: "Y.Horie" Date: Fri, 8 Apr 2022 06:01:09 +0900 Subject: staticfiles: Expand placeholder for index files (#4679) --- caddytest/integration/caddyfile_test.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'caddytest/integration/caddyfile_test.go') diff --git a/caddytest/integration/caddyfile_test.go b/caddytest/integration/caddyfile_test.go index 4e9bdd9..be85f4a 100644 --- a/caddytest/integration/caddyfile_test.go +++ b/caddytest/integration/caddyfile_test.go @@ -101,3 +101,27 @@ func TestReadCookie(t *testing.T) { // act and assert tester.AssertGetResponse("http://localhost:9080/cookie.html", 200, "

Cookie.ClientName caddytest

") } + +func TestReplIndex(t *testing.T) { + + tester := caddytest.NewTester(t) + tester.InitServer(` + { + http_port 9080 + https_port 9443 + } + + localhost:9080 { + templates { + root testdata + } + file_server { + root testdata + index "index.{host}.html" + } + } + `, "caddyfile") + + // act and assert + tester.AssertGetResponse("http://localhost:9080/", 200, "") +} -- cgit v1.2.3