summaryrefslogtreecommitdiff
path: root/system/admin/filesystem.go
diff options
context:
space:
mode:
Diffstat (limited to 'system/admin/filesystem.go')
-rw-r--r--system/admin/filesystem.go21
1 files changed, 10 insertions, 11 deletions
diff --git a/system/admin/filesystem.go b/system/admin/filesystem.go
index 4e64a26..77c721e 100644
--- a/system/admin/filesystem.go
+++ b/system/admin/filesystem.go
@@ -1,13 +1,12 @@
package admin
import (
- "net/http"
+ "net/http"
"os"
)
-
func restrict(dir http.Dir) justFilesFilesystem {
- return justFilesFilesystem{dir}
+ return justFilesFilesystem{dir}
}
// the code below removes the open directory listing when accessing a URL which
@@ -16,21 +15,21 @@ func restrict(dir http.Dir) justFilesFilesystem {
// credit: Brad Fitzpatrick (c) 2012
type justFilesFilesystem struct {
- fs http.FileSystem
+ fs http.FileSystem
}
func (fs justFilesFilesystem) Open(name string) (http.File, error) {
- f, err := fs.fs.Open(name)
- if err != nil {
- return nil, err
- }
- return neuteredReaddirFile{f}, nil
+ f, err := fs.fs.Open(name)
+ if err != nil {
+ return nil, err
+ }
+ return neuteredReaddirFile{f}, nil
}
type neuteredReaddirFile struct {
- http.File
+ http.File
}
func (f neuteredReaddirFile) Readdir(count int) ([]os.FileInfo, error) {
- return nil, nil
+ return nil, nil
}