summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/fileserver
diff options
context:
space:
mode:
authorY.Horie <u5.horie@gmail.com>2022-04-08 06:01:09 +0900
committerGitHub <noreply@github.com>2022-04-07 15:01:09 -0600
commitafca2421112eb89e435888f50f8146364a3c60a4 (patch)
treec61d9b2af04c9d40de8ea14bbd3aa99272829f98 /modules/caddyhttp/fileserver
parent7d229665ed96a6b1e5b89d6fd963ac54e2b56bb6 (diff)
staticfiles: Expand placeholder for index files (#4679)
Diffstat (limited to 'modules/caddyhttp/fileserver')
-rw-r--r--modules/caddyhttp/fileserver/staticfiles.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/modules/caddyhttp/fileserver/staticfiles.go b/modules/caddyhttp/fileserver/staticfiles.go
index 0114607..9a2bc6e 100644
--- a/modules/caddyhttp/fileserver/staticfiles.go
+++ b/modules/caddyhttp/fileserver/staticfiles.go
@@ -200,6 +200,7 @@ func (fsrv *FileServer) ServeHTTP(w http.ResponseWriter, r *http.Request, next c
var implicitIndexFile bool
if info.IsDir() && len(fsrv.IndexNames) > 0 {
for _, indexPage := range fsrv.IndexNames {
+ indexPage := repl.ReplaceAll(indexPage, "")
indexPath := caddyhttp.SanitizedPathJoin(filename, indexPage)
if fileHidden(indexPath, filesToHide) {
// pretend this file doesn't exist