ソースを参照

Add a default CSP

Disallows loading external ressources. Providers can override it with
their reverse proxy settings.
master
Simon Ser 4年前
コミット
3d2da43207
この署名に対応する既知のキーがデータベースに存在しません GPGキーID: FDE7BE0E88F5E48
1個のファイルの変更7行の追加0行の削除
  1. +7
    -0
      server.go

+ 7
- 0
server.go ファイルの表示

@@ -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)



読み込み中…
キャンセル
保存