Skip to content

Commit b965d15

Browse files
committed
Fix embedding livebook inside iframe with LIVEBOOK_WITHIN_IFRAME (#3024)
1 parent 736abe3 commit b965d15

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/livebook_web/router.ex

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,9 @@ defmodule LivebookWeb.Router do
178178

179179
defp within_iframe_secure_headers(conn, _opts) do
180180
if Livebook.Config.within_iframe?() do
181-
delete_resp_header(conn, "x-frame-options")
181+
[value] = get_resp_header(conn, "content-security-policy")
182+
value = String.replace(value, "frame-ancestors 'self';", "frame-ancestors *;")
183+
put_resp_header(conn, "content-security-policy", value)
182184
else
183185
conn
184186
end

0 commit comments

Comments
 (0)