Add strict transport security header in middleware

This commit is contained in:
2023-05-04 21:14:55 +02:00
parent aa9533e195
commit 15a1702063
3 changed files with 27 additions and 9 deletions

View File

@@ -35,7 +35,7 @@ func (wc *WebController) serveDirectory(w http.ResponseWriter, r *http.Request,
td.Title = fmt.Sprintf("%s ~ pixeldrain", node.Path[node.BaseIndex].Name)
td.Other = node
err = wc.templates.Get().ExecuteTemplate(w, "filesystem", td)
if err != nil && !strings.Contains(err.Error(), "broken pipe") {
if err != nil && !isNetError(err) {
log.Error("Error executing template filesystem: %s", err)
}
}