projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Replace `MastodonAPIController.account_register/2` rate limiter
[akkoma]
/
lib
/
pleroma
/
plugs
/
uploaded_media.ex
diff --git
a/lib/pleroma/plugs/uploaded_media.ex
b/lib/pleroma/plugs/uploaded_media.ex
index 13aa8641afcb2444d195ac87298d98fbb2c8f589..fd77b8d8f30500dac7ee7c868bc69be3924c28b0 100644
(file)
--- a/
lib/pleroma/plugs/uploaded_media.ex
+++ b/
lib/pleroma/plugs/uploaded_media.ex
@@
-24,6
+24,18
@@
defmodule Pleroma.Plugs.UploadedMedia do
end
def call(%{request_path: <<"/", @path, "/", file::binary>>} = conn, opts) do
end
def call(%{request_path: <<"/", @path, "/", file::binary>>} = conn, opts) do
+ conn =
+ case fetch_query_params(conn) do
+ %{query_params: %{"name" => name}} = conn ->
+ name = String.replace(name, "\"", "\\\"")
+
+ conn
+ |> put_resp_header("content-disposition", "filename=\"#{name}\"")
+
+ conn ->
+ conn
+ end
+
config = Pleroma.Config.get([Pleroma.Upload])
with uploader <- Keyword.fetch!(config, :uploader),
config = Pleroma.Config.get([Pleroma.Upload])
with uploader <- Keyword.fetch!(config, :uploader),