mirror of
https://github.com/jech/galene.git
synced 2024-11-25 10:05:58 +01:00
Rename mungeHeader to cspHeader.
This commit is contained in:
parent
1d89177ae9
commit
5c2e27b21d
1 changed files with 3 additions and 3 deletions
|
@ -86,7 +86,7 @@ func Serve(address string, dataDir string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
func mungeHeader(w http.ResponseWriter) {
|
||||
func cspHeader(w http.ResponseWriter) {
|
||||
w.Header().Add("Content-Security-Policy",
|
||||
"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) {
|
|||
return
|
||||
}
|
||||
|
||||
mungeHeader(w)
|
||||
cspHeader(w)
|
||||
p := r.URL.Path
|
||||
// this ensures any leading .. are removed by path.Clean below
|
||||
if !strings.HasPrefix(p, "/") {
|
||||
|
@ -316,7 +316,7 @@ func groupHandler(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
mungeHeader(w)
|
||||
cspHeader(w)
|
||||
serveFile(w, r, filepath.Join(StaticRoot, "galene.html"))
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue