improve (static): attempt at statically compile everything - revamp

This commit is contained in:
=
2019-04-27 18:13:43 +10:00
parent 2c7feed57a
commit ca5198ac0b
23 changed files with 319 additions and 195 deletions

View File

@ -234,7 +234,9 @@ func FileCat(ctx App, res http.ResponseWriter, req *http.Request) {
if contentLength != -1 {
header.Set("Content-Length", fmt.Sprintf("%d", contentLength))
}
header.Set("Content-Type", GetMimeType(req.URL.Query().Get("path")))
if header.Get("Content-Type") == "" {
header.Set("Content-Type", GetMimeType(req.URL.Query().Get("path")))
}
if header.Get("Content-Security-Policy") == "" {
header.Set("Content-Security-Policy", "default-src 'none'; img-src 'self'; style-src 'unsafe-inline'")
}