Restore commented out header and fix lint errors
This commit is contained in:
parent
8c60137fe4
commit
269bcb6c07
@ -49,7 +49,7 @@ func (d *data) Check(path string) bool {
|
||||
|
||||
func handle(fn handleFunc, prefix string, store *storage.Storage, server *settings.Server) http.Handler {
|
||||
handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
for k, v := range global_headers {
|
||||
for k, v := range globalHeaders {
|
||||
w.Header().Set(k, v)
|
||||
}
|
||||
|
||||
|
||||
@ -4,6 +4,6 @@
|
||||
package http
|
||||
|
||||
// global headers to append to every response
|
||||
var global_headers = map[string]string{
|
||||
var globalHeaders = map[string]string{
|
||||
"Cache-Control": "no-cache, no-store, must-revalidate",
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@ package http
|
||||
// global headers to append to every response
|
||||
// cross-origin headers are necessary to be able to
|
||||
// access them from a different URL during development
|
||||
var global_headers = map[string]string{
|
||||
var globalHeaders = map[string]string{
|
||||
"Cache-Control": "no-cache, no-store, must-revalidate",
|
||||
"Access-Control-Allow-Origin": "*",
|
||||
"Access-Control-Allow-Headers": "*",
|
||||
|
||||
@ -27,7 +27,7 @@ func NewHandler(
|
||||
r := mux.NewRouter()
|
||||
r.Use(func(next http.Handler) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
// w.Header().Set("Content-Security-Policy", `default-src 'self'; style-src 'unsafe-inline';`)
|
||||
w.Header().Set("Content-Security-Policy", `default-src 'self'; style-src 'unsafe-inline';`)
|
||||
next.ServeHTTP(w, r)
|
||||
})
|
||||
})
|
||||
|
||||
Loading…
Reference in New Issue
Block a user