diff options
author | Y.Horie <u5.horie@gmail.com> | 2022-04-08 06:01:09 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-07 15:01:09 -0600 |
commit | afca2421112eb89e435888f50f8146364a3c60a4 (patch) | |
tree | c61d9b2af04c9d40de8ea14bbd3aa99272829f98 /caddytest | |
parent | 7d229665ed96a6b1e5b89d6fd963ac54e2b56bb6 (diff) |
staticfiles: Expand placeholder for index files (#4679)
Diffstat (limited to 'caddytest')
-rw-r--r-- | caddytest/integration/caddyfile_test.go | 24 | ||||
-rw-r--r-- | caddytest/integration/testdata/index.localhost.html | 0 |
2 files changed, 24 insertions, 0 deletions
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, "<h2>Cookie.ClientName caddytest</h2>") } + +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, "") +} diff --git a/caddytest/integration/testdata/index.localhost.html b/caddytest/integration/testdata/index.localhost.html new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/caddytest/integration/testdata/index.localhost.html |