projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add basic config endpoint.
[akkoma]
/
lib
/
pleroma
/
upload.ex
diff --git
a/lib/pleroma/upload.ex
b/lib/pleroma/upload.ex
index 43ebe98e3d709288b572ead2b035c404fa262ff4..d22421d37049d8d4892037b83c89b90718a995a5 100644
(file)
--- a/
lib/pleroma/upload.ex
+++ b/
lib/pleroma/upload.ex
@@
-8,7
+8,11
@@
defmodule Pleroma.Upload do
%{
"type" => "Image",
%{
"type" => "Image",
- "href" => url_for(Path.join(uuid, file.filename)),
+ "url" => [%{
+ "type" => "Link",
+ "mediaType" => file.content_type,
+ "href" => url_for(Path.join(uuid, file.filename))
+ }],
"name" => file.filename,
"uuid" => uuid
}
"name" => file.filename,
"uuid" => uuid
}
@@
-20,11
+24,6
@@
defmodule Pleroma.Upload do
end
defp url_for(file) do
end
defp url_for(file) do
- host =
- Application.get_env(:pleroma, Pleroma.Web.Endpoint)
- |> Keyword.fetch!(:url)
- |> Keyword.fetch!(:host)
-
- "https://#{host}/media/#{file}"
+ "#{Pleroma.Web.base_url()}/media/#{file}"
end
end
end
end