mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-09-08 05:54:20 +08:00
Specify ip for iframe endpoint only when present (#1176)
* Specify ip for iframe endpoint only when present * Up
This commit is contained in:
parent
c1a4c8c045
commit
9f24bda2c8
1 changed files with 8 additions and 6 deletions
|
@ -197,12 +197,14 @@ defmodule Livebook.Application do
|
|||
port = Livebook.Config.iframe_port()
|
||||
|
||||
if server? do
|
||||
iframe_opts = [
|
||||
scheme: :http,
|
||||
plug: LivebookWeb.IframeEndpoint,
|
||||
options: [port: port],
|
||||
ip: Application.fetch_env!(:livebook, LivebookWeb.Endpoint)[:http][:ip]
|
||||
]
|
||||
http = Application.fetch_env!(:livebook, LivebookWeb.Endpoint)[:http]
|
||||
|
||||
iframe_opts =
|
||||
[
|
||||
scheme: :http,
|
||||
plug: LivebookWeb.IframeEndpoint,
|
||||
port: port
|
||||
] ++ Keyword.take(http, [:ip])
|
||||
|
||||
spec = Plug.Cowboy.child_spec(iframe_opts)
|
||||
spec = update_in(spec.start, &{__MODULE__, :start_iframe, [port, &1]})
|
||||
|
|
Loading…
Add table
Reference in a new issue