refactor: markup render (#38864) (#38869)

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:
wxiaoguang
2026-08-12 00:00:47 +08:00
committed by GitHub
parent 9ab9c18919
commit 21fda8f5be
14 changed files with 70 additions and 69 deletions
+2 -1
View File
@@ -9,6 +9,7 @@ import (
"net/url"
"testing"
"gitea.dev/modules/reqctx"
"gitea.dev/modules/setting"
"gitea.dev/modules/test"
@@ -57,7 +58,7 @@ func TestAppFullLink(t *testing.T) {
defer test.MockVariableValue(&setting.PublicURLDetection, setting.PublicURLNever)()
req := httptest.NewRequest(http.MethodGet, "https://gitea.example.com/sub/", nil)
tmplCtx := NewTemplateContext(req.Context(), req)
tmplCtx := NewTemplateContext(reqctx.NewRequestContextForTest(req.Context()), req)
assert.Equal(t, "https://gitea.example.com/sub", string(tmplCtx.AppFullLink()))
assert.Equal(t, "https://gitea.example.com/sub/user/repo", string(tmplCtx.AppFullLink("user/repo")))