Commit df3233e7 authored by Hakaba Hitoyo's avatar Hakaba Hitoyo

improve getting host name

parent e7c58082
......@@ -1076,7 +1076,11 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
@suggestions Application.get_env(:pleroma, :suggestions)
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
api = Keyword.get(@suggestions, :third_party_engine, "")
url = String.replace(api, "{{host}}", host) |> String.replace("{{user}}", user)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment