Explorar el Código

Add a default CSP

Disallows loading external ressources. Providers can override it with
their reverse proxy settings.
master
Simon Ser hace 4 años
padre
commit
3d2da43207
No se encontró ninguna clave conocida en la base de datos para esta firma ID de clave GPG: FDE7BE0E88F5E48
Se han modificado 1 ficheros con 7 adiciones y 0 borrados
  1. +7
    -0
      server.go

+ 7
- 0
server.go Ver fichero

@@ -168,6 +168,13 @@ func New(e *echo.Echo, options *Options) error {

e.Use(func(next echo.HandlerFunc) echo.HandlerFunc {
return func(ectx echo.Context) error {
ectx.Response().Header().Set("Content-Security-Policy", "default-src 'self'")
return next(ectx)
}
})

e.Use(func(next echo.HandlerFunc) echo.HandlerFunc {
return func(ectx echo.Context) error {
ctx := &Context{Context: ectx, Server: s}
ctx.Set("context", ctx)



Cargando…
Cancelar
Guardar