forked from potsda.mn/mobilizon
Comment Webfinger controller properly
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
caae6d0c0a
commit
d5eac1df6c
|
@ -4,10 +4,16 @@
|
||||||
# Upstream: https://git.pleroma.social/pleroma/pleroma/blob/develop/lib/pleroma/web/web_finger/web_finger_controller.ex
|
# Upstream: https://git.pleroma.social/pleroma/pleroma/blob/develop/lib/pleroma/web/web_finger/web_finger_controller.ex
|
||||||
|
|
||||||
defmodule MobilizonWeb.WebFingerController do
|
defmodule MobilizonWeb.WebFingerController do
|
||||||
|
@moduledoc """
|
||||||
|
Handles Webfinger requests
|
||||||
|
"""
|
||||||
use MobilizonWeb, :controller
|
use MobilizonWeb, :controller
|
||||||
|
|
||||||
alias Mobilizon.Service.WebFinger
|
alias Mobilizon.Service.WebFinger
|
||||||
|
|
||||||
|
@doc """
|
||||||
|
Provides /.well-known/host-meta
|
||||||
|
"""
|
||||||
def host_meta(conn, _params) do
|
def host_meta(conn, _params) do
|
||||||
xml = WebFinger.host_meta()
|
xml = WebFinger.host_meta()
|
||||||
|
|
||||||
|
@ -16,6 +22,9 @@ defmodule MobilizonWeb.WebFingerController do
|
||||||
|> send_resp(200, xml)
|
|> send_resp(200, xml)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@doc """
|
||||||
|
Provides /.well-known/webfinger
|
||||||
|
"""
|
||||||
def webfinger(conn, %{"resource" => resource}) do
|
def webfinger(conn, %{"resource" => resource}) do
|
||||||
with {:ok, response} <- WebFinger.webfinger(resource, "JSON") do
|
with {:ok, response} <- WebFinger.webfinger(resource, "JSON") do
|
||||||
json(conn, response)
|
json(conn, response)
|
||||||
|
@ -24,7 +33,5 @@ defmodule MobilizonWeb.WebFingerController do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def webfinger(conn, _) do
|
def webfinger(conn, _), do: send_resp(conn, 400, "No query provided")
|
||||||
send_resp(conn, 400, "No query provided")
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
# Upstream: https://git.pleroma.social/pleroma/pleroma/blob/develop/test/web/activity_pub/transmogrifier_test.exs
|
# Upstream: https://git.pleroma.social/pleroma/pleroma/blob/develop/test/web/activity_pub/transmogrifier_test.exs
|
||||||
|
|
||||||
defmodule Mobilizon.Service.ActivityPub.TransmogrifierTest do
|
defmodule Mobilizon.Service.ActivityPub.TransmogrifierTest do
|
||||||
|
|
||||||
use Mobilizon.DataCase
|
use Mobilizon.DataCase
|
||||||
|
|
||||||
import Mobilizon.Factory
|
import Mobilizon.Factory
|
||||||
|
|
Loading…
Reference in a new issue