Fix if real ip not present in headers.
Exclude more addresses from telegram messages.
This commit is contained in:
parent
5e974da721
commit
2140a165fd
2 changed files with 11 additions and 3 deletions
|
@ -11,7 +11,10 @@ defmodule UiWeb.PageController do
|
|||
end
|
||||
|
||||
def morse(conn, _params) do
|
||||
ip = conn |> Plug.Conn.get_req_header("x-real-ip") |> hd()
|
||||
ip = case Plug.Conn.get_req_header(conn, "x-real-ip") do
|
||||
[h|_tl] -> h
|
||||
_ -> "0.0.0.0"
|
||||
end
|
||||
LiveView.Controller.live_render(conn, UiWeb.MorseLive, session: %{ip: ip})
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue