Commit 5c2e27b2 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Rename mungeHeader to cspHeader.

parent 1d89177a
...@@ -86,7 +86,7 @@ func Serve(address string, dataDir string) error { ...@@ -86,7 +86,7 @@ func Serve(address string, dataDir string) error {
return err return err
} }
func mungeHeader(w http.ResponseWriter) { func cspHeader(w http.ResponseWriter) {
w.Header().Add("Content-Security-Policy", w.Header().Add("Content-Security-Policy",
"connect-src ws: wss: 'self'; img-src data: 'self'; media-src blob: 'self'; default-src 'self'") "connect-src ws: wss: 'self'; img-src data: 'self'; media-src blob: 'self'; default-src 'self'")
} }
...@@ -174,7 +174,7 @@ func (fh *fileHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { ...@@ -174,7 +174,7 @@ func (fh *fileHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
return return
} }
mungeHeader(w) cspHeader(w)
p := r.URL.Path p := r.URL.Path
// this ensures any leading .. are removed by path.Clean below // this ensures any leading .. are removed by path.Clean below
if !strings.HasPrefix(p, "/") { if !strings.HasPrefix(p, "/") {
...@@ -316,7 +316,7 @@ func groupHandler(w http.ResponseWriter, r *http.Request) { ...@@ -316,7 +316,7 @@ func groupHandler(w http.ResponseWriter, r *http.Request) {
return return
} }
mungeHeader(w) cspHeader(w)
serveFile(w, r, filepath.Join(StaticRoot, "galene.html")) serveFile(w, r, filepath.Join(StaticRoot, "galene.html"))
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment