summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarcin mikołajczak <git@mkljczk.pl>2022-11-22 23:34:23 +0100
committermarcin mikołajczak <git@mkljczk.pl>2023-10-25 00:38:10 +0200
commit5ff3783d018476bad954881e39f714fac0630436 (patch)
tree9684185d0cfb856f2a5cde086b5bcf403a14a219
parente3ea311cd594d4f0bc8c4e05ca8eb1eee18ae6be (diff)
downloadpleroma-5ff3783d018476bad954881e39f714fac0630436.tar.gz
pleroma-5ff3783d018476bad954881e39f714fac0630436.zip
Use correct domain for fqn and InstanceView
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
-rw-r--r--lib/pleroma/user.ex2
-rw-r--r--lib/pleroma/web/mastodon_api/views/instance_view.ex2
-rw-r--r--lib/pleroma/web/web_finger.ex2
3 files changed, 3 insertions, 3 deletions
diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex
index ce125d608..a0d4aca66 100644
--- a/lib/pleroma/user.ex
+++ b/lib/pleroma/user.ex
@@ -2252,7 +2252,7 @@ defmodule Pleroma.User do
if String.contains?(user.nickname, "@") do
user.nickname
else
- %{host: host} = URI.parse(user.ap_id)
+ host = Pleroma.Web.WebFinger.domain()
user.nickname <> "@" <> host
end
end
diff --git a/lib/pleroma/web/mastodon_api/views/instance_view.ex b/lib/pleroma/web/mastodon_api/views/instance_view.ex
index 1b01d7371..aef02a418 100644
--- a/lib/pleroma/web/mastodon_api/views/instance_view.ex
+++ b/lib/pleroma/web/mastodon_api/views/instance_view.ex
@@ -14,7 +14,7 @@ defmodule Pleroma.Web.MastodonAPI.InstanceView do
instance = Config.get(:instance)
%{
- uri: Pleroma.Web.Endpoint.url(),
+ uri: Pleroma.Web.WebFinger.domain(),
title: Keyword.get(instance, :name),
description: Keyword.get(instance, :description),
short_description: Keyword.get(instance, :short_description),
diff --git a/lib/pleroma/web/web_finger.ex b/lib/pleroma/web/web_finger.ex
index f95dc2458..b28fad8d1 100644
--- a/lib/pleroma/web/web_finger.ex
+++ b/lib/pleroma/web/web_finger.ex
@@ -96,7 +96,7 @@ defmodule Pleroma.Web.WebFinger do
|> XmlBuilder.to_doc()
end
- defp domain do
+ def domain do
Pleroma.Config.get([__MODULE__, :domain]) || Pleroma.Web.Endpoint.host()
end