forked from AkkomaGang/akkoma
improve getting host name
This commit is contained in:
parent
e7c580828c
commit
df3233e7e7
1 changed files with 5 additions and 1 deletions
|
@ -1076,7 +1076,11 @@ def errors(conn, _) do
|
||||||
@suggestions Application.get_env(:pleroma, :suggestions)
|
@suggestions Application.get_env(:pleroma, :suggestions)
|
||||||
|
|
||||||
def suggestions(%{assigns: %{user: user}} = conn, _) do
|
def suggestions(%{assigns: %{user: user}} = conn, _) do
|
||||||
host = String.replace(Web.base_url(), "https://", "")
|
host =
|
||||||
|
Application.get_env(:pleroma, Pleroma.Web.Endpoint)
|
||||||
|
|> Keyword.get(:url)
|
||||||
|
|> Keyword.get(:host)
|
||||||
|
|
||||||
user = user.nickname
|
user = user.nickname
|
||||||
api = Keyword.get(@suggestions, :third_party_engine, "")
|
api = Keyword.get(@suggestions, :third_party_engine, "")
|
||||||
url = String.replace(api, "{{host}}", host) |> String.replace("{{user}}", user)
|
url = String.replace(api, "{{host}}", host) |> String.replace("{{user}}", user)
|
||||||
|
|
Loading…
Reference in a new issue