Return the file content for GET /api/pleroma/admin/instance_document/:document_name

This commit is contained in:
eugenijm 2020-09-17 16:54:38 +03:00
commit c711a2b157
5 changed files with 26 additions and 21 deletions

View file

@ -14,7 +14,7 @@ defmodule Pleroma.Web.InstanceDocument do
@spec get(String.t()) :: {:ok, String.t()} | {:error, atom()}
def get(document_name) do
case Map.fetch(@instance_documents, document_name) do
{:ok, path} -> {:ok, Path.join(Endpoint.url(), path)}
{:ok, path} -> {:ok, path}
_ -> {:error, :not_found}
end
end