summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/fileserver/staticfiles.go
diff options
context:
space:
mode:
authorJason Du <xdu@infoblox.com>2021-04-30 19:17:23 -0700
committerGitHub <noreply@github.com>2021-04-30 22:17:23 -0400
commit637fd8f67b7ff6191673ff13e94825a4ec896891 (patch)
treea50995058c76b6449dd6eb41013f75f9495bb969 /modules/caddyhttp/fileserver/staticfiles.go
parent956f01163d150b70aa3d5fc418ba9f150bd25c24 (diff)
fileserver: Share template logic for both `templates` and `file_server browse` (#4093)
Co-authored-by: Matthew Holt <mholt@users.noreply.github.com>
Diffstat (limited to 'modules/caddyhttp/fileserver/staticfiles.go')
-rw-r--r--modules/caddyhttp/fileserver/staticfiles.go18
1 files changed, 0 insertions, 18 deletions
diff --git a/modules/caddyhttp/fileserver/staticfiles.go b/modules/caddyhttp/fileserver/staticfiles.go
index dd44817..f2320aa 100644
--- a/modules/caddyhttp/fileserver/staticfiles.go
+++ b/modules/caddyhttp/fileserver/staticfiles.go
@@ -17,7 +17,6 @@ package fileserver
import (
"bytes"
"fmt"
- "html/template"
weakrand "math/rand"
"mime"
"net/http"
@@ -118,23 +117,6 @@ func (fsrv *FileServer) Provision(ctx caddy.Context) error {
fsrv.IndexNames = defaultIndexNames
}
- if fsrv.Browse != nil {
- var tpl *template.Template
- var err error
- if fsrv.Browse.TemplateFile != "" {
- tpl, err = template.ParseFiles(fsrv.Browse.TemplateFile)
- if err != nil {
- return fmt.Errorf("parsing browse template file: %v", err)
- }
- } else {
- tpl, err = template.New("default_listing").Parse(defaultBrowseTemplate)
- if err != nil {
- return fmt.Errorf("parsing default browse template: %v", err)
- }
- }
- fsrv.Browse.template = tpl
- }
-
// for hide paths that are static (i.e. no placeholders), we can transform them into
// absolute paths before the server starts for very slight performance improvement
for i, h := range fsrv.Hide {