mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-06-16 06:05:06 +03:00
Disabled static http resources caching RIVM-30
This commit is contained in:
parent
267a9109c6
commit
028539356c
1 changed files with 9 additions and 1 deletions
|
@ -397,7 +397,15 @@ func (a *AdminSocket) StartHttpServer(configFn string, nc *config.NodeConfig) {
|
|||
}
|
||||
}
|
||||
if docFs == "" {
|
||||
http.Handle("/", http.FileServer(http.Dir(nc.WwwRoot)))
|
||||
var nocache = func(fs http.Handler) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Add("Cache-Control", "no-cache, no-store, must-revalidate")
|
||||
w.Header().Add("Pragma", "no-cache")
|
||||
w.Header().Add("Expires", "0")
|
||||
fs.ServeHTTP(w, r)
|
||||
}
|
||||
}
|
||||
http.Handle("/", nocache(http.FileServer(http.Dir(nc.WwwRoot))))
|
||||
docFs = "local fs"
|
||||
}
|
||||
l, e := net.Listen("tcp4", u.Host)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue