diff --git a/routers/common/repo.go b/routers/common/repo.go index b3cd749115fb1..c127dcbc23caa 100644 --- a/routers/common/repo.go +++ b/routers/common/repo.go @@ -88,7 +88,7 @@ func ServeData(ctx *context.Context, name string, size int64, reader io.Reader) } if (st.IsImage() || st.IsPDF()) && (setting.UI.SVG.Enabled || !st.IsSvgImage()) { ctx.Resp.Header().Set("Content-Disposition", fmt.Sprintf(`inline; filename="%s"`, name)) - if st.IsSvgImage() || st.IsPDF() { + if st.IsSvgImage() { ctx.Resp.Header().Set("Content-Security-Policy", "default-src 'none'; style-src 'unsafe-inline'; sandbox") ctx.Resp.Header().Set("X-Content-Type-Options", "nosniff") if st.IsSvgImage() {