diff options
author | Hakaba Hitoyo <hakabahitoyo@example.com> | 2018-07-17 13:20:58 +0900 |
---|---|---|
committer | Hakaba Hitoyo <hakabahitoyo@example.com> | 2018-07-17 13:20:58 +0900 |
commit | df3233e7e798563afe4b5a937b0bdd13e101973b (patch) | |
tree | 93319b635dfdb85a9d5424b3682786f8858abe1c | |
parent | e7c580828c109247de11624bae8c7286b02441e5 (diff) | |
download | pleroma-df3233e7e798563afe4b5a937b0bdd13e101973b.tar.gz |
improve getting host name
-rw-r--r-- | lib/pleroma/web/mastodon_api/mastodon_api_controller.ex | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex index e397b911d..2f8139fe6 100644 --- a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex +++ b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex @@ -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) |