1
1
mirror of https://github.com/go-gitea/gitea synced 2025-10-28 09:58:25 +00:00

Fix rendered wiki page link (#31398) (#31407)

Backport #31398

Fix #31395
This commit is contained in:
wxiaoguang
2024-06-19 11:23:24 +08:00
committed by GitHub
parent e8e43a7ee4
commit 042e9fcd81
11 changed files with 62 additions and 78 deletions

View File

@@ -47,7 +47,7 @@ func RenderFile(ctx *context.Context) {
rd := charset.ToUTF8WithFallbackReader(io.MultiReader(bytes.NewReader(buf), dataRc), charset.ConvertOpts{})
ctx.Resp.Header().Add("Content-Security-Policy", "frame-src 'self'; sandbox allow-scripts")
if markupType := markup.Type(blob.Name()); markupType == "" {
if markupType := markup.DetectMarkupTypeByFileName(blob.Name()); markupType == "" {
if isTextFile {
_, _ = io.Copy(ctx.Resp, rd)
} else {