Skip to content

Commit

Permalink
fix: xss vulnerability in /api/raw (#2570) (#2572)
Browse files Browse the repository at this point in the history
  • Loading branch information
IceWreck committed Jul 27, 2023
1 parent ff4375c commit b508ac3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion http/raw.go
Expand Up @@ -207,7 +207,7 @@ func rawFileHandler(w http.ResponseWriter, r *http.Request, file *files.FileInfo
defer fd.Close()

setContentDisposition(w, r, file)

w.Header().Add("Content-Security-Policy", `script-src 'none';`)
w.Header().Set("Cache-Control", "private")
http.ServeContent(w, r, file.Name, file.ModTime, fd)
return 0, nil
Expand Down

0 comments on commit b508ac3

Please sign in to comment.