nulla/lib/nulla_web/controllers/activitypub/hostmeta_controller.ex
2025-07-01 10:15:06 +02:00

18 lines
504 B
Elixir

defmodule NullaWeb.ActivityPub.HostmetaController do
use NullaWeb, :controller
def index(conn, _params) do
domain = NullaWeb.Endpoint.host()
xml = """
<?xml version="1.0" encoding="UTF-8"?>
<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">
<Link rel="lrdd" type="application/xrd+xml" template="https://#{domain}/.well-known/webfinger?resource={uri}"/>
</XRD>
"""
conn
|> put_resp_content_type("application/xrd+xml")
|> send_resp(200, xml)
end
end