From 4cb2247f909d02c922edb6f8e3d3741cc5a2c077 Mon Sep 17 00:00:00 2001 From: Valery Piashchynski Date: Mon, 26 Apr 2021 21:49:52 +0300 Subject: - Update defaults Signed-off-by: Valery Piashchynski --- plugins/http/config/http.go | 3 +++ plugins/http/config/static.go | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/http/config/http.go b/plugins/http/config/http.go index 53a22f3c..59735e2e 100644 --- a/plugins/http/config/http.go +++ b/plugins/http/config/http.go @@ -108,6 +108,9 @@ func (c *HTTP) InitDefaults() error { if c.Static.Pattern == "" { c.Static.Pattern = "/static/" } + if c.Static.Dir == "" { + c.Static.Dir = "." + } } err := c.HTTP2Config.InitDefaults() diff --git a/plugins/http/config/static.go b/plugins/http/config/static.go index 416169d2..e9acc3e4 100644 --- a/plugins/http/config/static.go +++ b/plugins/http/config/static.go @@ -9,11 +9,12 @@ import ( // Static describes file location and controls access to them. type Static struct { // Dir contains name of directory to control access to. + // Default - "." Dir string // HTTP pattern, where to serve static files - // for example - `/static`, `/my-files/static`, etc - // Default - /static + // for example - `/static/`, `/my-files/static/`, etc + // Default - /static/ Pattern string // forbid specifies list of file extensions which are forbidden for access. -- cgit v1.2.3