summaryrefslogtreecommitdiff
path: root/service/static/service.go
diff options
context:
space:
mode:
Diffstat (limited to 'service/static/service.go')
-rw-r--r--service/static/service.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/service/static/service.go b/service/static/service.go
index 2cb419fe..b824e787 100644
--- a/service/static/service.go
+++ b/service/static/service.go
@@ -45,12 +45,17 @@ func (s *Service) middleware(f http.HandlerFunc) http.HandlerFunc {
func (s *Service) handleStatic(w http.ResponseWriter, r *http.Request) bool {
fPath := path.Clean(r.URL.Path)
- if s.cfg.Forbids(fPath) {
+ if s.cfg.AlwaysForbid(fPath) {
return false
}
f, err := s.root.Open(fPath)
if err != nil {
+ if s.cfg.AlwaysServe(fPath) {
+ w.WriteHeader(404)
+ return true
+ }
+
return false
}
defer f.Close()