nulla/lib/nulla_web/controllers/hostmeta_controller.ex
2025-06-30 14:03:57 +02:00

18 lines
492 B
Elixir

defmodule NullaWeb.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