aboutsummaryrefslogtreecommitdiff
path: root/lib/http/server.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2019-04-18 13:23:31 +0700
committerShulhan <ms@kilabit.info>2019-04-19 00:39:57 +0700
commitba856c69c5f9cb3b0d0fa1983dae38bcb2686ccb (patch)
tree22b360e2187649261f1644c9fcc9995bedb522ff /lib/http/server.go
parent5ba996b3e0e52d06c09d79d2f10526f4e6277028 (diff)
downloadpakakeh.go-ba856c69c5f9cb3b0d0fa1983dae38bcb2686ccb.tar.xz
memfs: add parameter to make reading file content become optional
Previously, when a directory is mount-ed, all the content of file will be mapped to memory as long as its size less than MaxFileSize. The new parameter "withContent" allow the file content to be mapped or not mapped to memory. If its false, the MemFS will behave as directory tree.
Diffstat (limited to 'lib/http/server.go')
-rw-r--r--lib/http/server.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/http/server.go b/lib/http/server.go
index 15261b00..ae8e338b 100644
--- a/lib/http/server.go
+++ b/lib/http/server.go
@@ -65,7 +65,7 @@ func NewServer(opts *ServerOptions) (srv *Server, e error) {
memfs.Development = opts.Development
- srv.mfs, e = memfs.New(opts.Includes, opts.Excludes)
+ srv.mfs, e = memfs.New(opts.Includes, opts.Excludes, true)
if e != nil {
return nil, e
}