aboutsummaryrefslogtreecommitdiffhomepage
path: root/modules/caddyhttp/fileserver/caddyfile.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/caddyhttp/fileserver/caddyfile.go')
-rw-r--r--modules/caddyhttp/fileserver/caddyfile.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/modules/caddyhttp/fileserver/caddyfile.go b/modules/caddyhttp/fileserver/caddyfile.go
index 6ad9190f3..d90e4f9a0 100644
--- a/modules/caddyhttp/fileserver/caddyfile.go
+++ b/modules/caddyhttp/fileserver/caddyfile.go
@@ -113,13 +113,15 @@ func (fsrv *FileServer) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
fsrv.Browse = new(Browse)
d.Args(&fsrv.Browse.TemplateFile)
for nesting := d.Nesting(); d.NextBlock(nesting); {
- if d.Val() != "reveal_symlinks" {
+ switch d.Val() {
+ case "reveal_symlinks":
+ if fsrv.Browse.RevealSymlinks {
+ return d.Err("Symlinks path reveal is already enabled")
+ }
+ fsrv.Browse.RevealSymlinks = true
+ default:
return d.Errf("unknown subdirective '%s'", d.Val())
}
- if fsrv.Browse.RevealSymlinks {
- return d.Err("Symlinks path reveal is already enabled")
- }
- fsrv.Browse.RevealSymlinks = true
}
case "precompressed":