Reevaluate and update firewall core logic
This commit is contained in:
@@ -103,6 +103,7 @@ func ServeFileFromBundle(w http.ResponseWriter, r *http.Request, bundleName stri
|
||||
return
|
||||
}
|
||||
|
||||
// set content type
|
||||
_, ok := w.Header()["Content-Type"]
|
||||
if !ok {
|
||||
contentType := mime.TypeByExtension(filepath.Ext(path))
|
||||
@@ -111,6 +112,9 @@ func ServeFileFromBundle(w http.ResponseWriter, r *http.Request, bundleName stri
|
||||
}
|
||||
}
|
||||
|
||||
// set content security policy
|
||||
w.Header().Set("Content-Security-Policy", "default-src 'self'")
|
||||
|
||||
w.WriteHeader(http.StatusOK)
|
||||
if r.Method != "HEAD" {
|
||||
_, err = io.Copy(w, readCloser)
|
||||
|
||||
Reference in New Issue
Block a user