소스 검색

Add a default CSP

Disallows loading external ressources. Providers can override it with
their reverse proxy settings.
master
Simon Ser 4 년 전
부모
커밋
3d2da43207
No known key found for this signature in database 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)



불러오는 중...
취소
저장