Fix iframe static serving

This commit is contained in:
Jonatan Kłosko 2024-11-21 21:08:35 +08:00
parent 04ac1751f6
commit adb1c67937

View file

@ -4,6 +4,7 @@ defmodule LivebookWeb.IframeEndpoint do
plug Plug.Static, plug Plug.Static,
at: "/iframe", at: "/iframe",
from: {__MODULE__, :static_from, []}, from: {__MODULE__, :static_from, []},
gzip: true,
# Iframes are versioned, so we cache them for long # Iframes are versioned, so we cache them for long
cache_control_for_etags: "public, max-age=31536000", cache_control_for_etags: "public, max-age=31536000",
headers: [ headers: [
@ -13,7 +14,7 @@ defmodule LivebookWeb.IframeEndpoint do
] ]
@doc false @doc false
def static_from(), do: Path.join(Livebook.Config.priv_path(), "static_iframe") def static_from(), do: Path.join(Livebook.Config.priv_path(), "iframe_static")
plug :not_found plug :not_found