projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make activity announceable by its author.
[akkoma]
/
lib
/
pleroma
/
plugs
/
uploaded_media.ex
diff --git
a/lib/pleroma/plugs/uploaded_media.ex
b/lib/pleroma/plugs/uploaded_media.ex
index bc913f4087e8ddc61ca74ed4b0f4a15c0b2fa48f..69c1ab942769ca657a076fe5072d6163c56dcbd8 100644
(file)
--- a/
lib/pleroma/plugs/uploaded_media.ex
+++ b/
lib/pleroma/plugs/uploaded_media.ex
@@
-7,6
+7,7
@@
defmodule Pleroma.Plugs.UploadedMedia do
"""
import Plug.Conn
"""
import Plug.Conn
+ import Pleroma.Web.Gettext
require Logger
@behaviour Plug
require Logger
@behaviour Plug
@@
-30,13
+31,13
@@
defmodule Pleroma.Plugs.UploadedMedia do
name = String.replace(name, "\"", "\\\"")
conn
name = String.replace(name, "\"", "\\\"")
conn
- |> put_resp_header("
Content-D
isposition", "filename=\"#{name}\"")
+ |> put_resp_header("
content-d
isposition", "filename=\"#{name}\"")
conn ->
conn
end
conn ->
conn
end
- config = Pleroma.Config.get(
[Pleroma.Upload]
)
+ config = Pleroma.Config.get(
Pleroma.Upload
)
with uploader <- Keyword.fetch!(config, :uploader),
proxy_remote = Keyword.get(config, :proxy_remote, false),
with uploader <- Keyword.fetch!(config, :uploader),
proxy_remote = Keyword.get(config, :proxy_remote, false),
@@
-45,7
+46,7
@@
defmodule Pleroma.Plugs.UploadedMedia do
else
_ ->
conn
else
_ ->
conn
- |> send_resp(
500, "Failed"
)
+ |> send_resp(
:internal_server_error, dgettext("errors", "Failed")
)
|> halt()
end
end
|> halt()
end
end
@@
-64,7
+65,7
@@
defmodule Pleroma.Plugs.UploadedMedia do
conn
else
conn
conn
else
conn
- |> send_resp(
404, "Not found"
)
+ |> send_resp(
:not_found, dgettext("errors", "Not found")
)
|> halt()
end
end
|> halt()
end
end
@@
-84,7
+85,7
@@
defmodule Pleroma.Plugs.UploadedMedia do
Logger.error("#{__MODULE__}: Unknown get startegy: #{inspect(unknown)}")
conn
Logger.error("#{__MODULE__}: Unknown get startegy: #{inspect(unknown)}")
conn
- |> send_resp(
500, "Internal Error"
)
+ |> send_resp(
:internal_server_error, dgettext("errors", "Internal Error")
)
|> halt()
end
end
|> halt()
end
end