mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-12 18:48:25 +00:00
backport #38864 1. add missing CSP header to api & web render endpoints. 2. make jupyter render skip post-processors, nothing to process
This commit is contained in:
@@ -64,6 +64,9 @@ func RenderFile(ctx *context.Context) {
|
||||
extRendererOpts := extRenderer.GetExternalRendererOptions()
|
||||
if extRendererOpts.ContentSandbox != "" {
|
||||
ctx.Resp.Header().Add("Content-Security-Policy", "sandbox "+extRendererOpts.ContentSandbox)
|
||||
} else {
|
||||
// if no sandbox, just apply the same CSP as a general Gitea web page
|
||||
ctx.SetHeaderContentSecurityPolicyGeneral()
|
||||
}
|
||||
|
||||
err = markup.RenderWithRenderer(rctx, renderer, rendererInput, ctx.Resp)
|
||||
|
||||
Reference in New Issue
Block a user