mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-09-04 12:04:20 +08:00
Fix embedding livebook inside iframe with LIVEBOOK_WITHIN_IFRAME (#3024)
This commit is contained in:
parent
334ae5523e
commit
509774bcb4
1 changed files with 3 additions and 1 deletions
|
@ -178,7 +178,9 @@ defmodule LivebookWeb.Router do
|
|||
|
||||
defp within_iframe_secure_headers(conn, _opts) do
|
||||
if Livebook.Config.within_iframe?() do
|
||||
delete_resp_header(conn, "x-frame-options")
|
||||
[value] = get_resp_header(conn, "content-security-policy")
|
||||
value = String.replace(value, "frame-ancestors 'self';", "frame-ancestors *;")
|
||||
put_resp_header(conn, "content-security-policy", value)
|
||||
else
|
||||
conn
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue