Skip to content

Commit

Permalink
Add frame-ancestors 'self'
Browse files Browse the repository at this point in the history
  • Loading branch information
lunny committed Apr 8, 2024
1 parent 1adb00d commit 5b2d7b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion routers/web/repo/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func RenderFile(ctx *context.Context) {
isTextFile := st.IsText()

rd := charset.ToUTF8WithFallbackReader(io.MultiReader(bytes.NewReader(buf), dataRc), charset.ConvertOpts{})
ctx.Resp.Header().Add("Content-Security-Policy", "frame-src 'self'; sandbox allow-scripts")
ctx.Resp.Header().Add("Content-Security-Policy", "frame-src 'self'; frame-ancestors 'self'; sandbox allow-scripts")

if markupType := markup.Type(blob.Name()); markupType == "" {
if isTextFile {
Expand Down

0 comments on commit 5b2d7b6

Please sign in to comment.