summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorduponin <duponin@locahlo.st>2022-12-11 23:15:08 +0100
committerduponin <duponin@locahlo.st>2022-12-11 23:15:08 +0100
commit987674235814205344d320c0e4c21df17b1cdd15 (patch)
treef20a6701c3b5d3051ed68576069515131fcc9d0b /lib
parent452595baeda8327b862d03e450ac004679efe86e (diff)
Return 413 when an actor's banner or background exceeds the size limit
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/mastodon_api/controllers/account_controller.ex6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/pleroma/web/mastodon_api/controllers/account_controller.ex b/lib/pleroma/web/mastodon_api/controllers/account_controller.ex
index 656a861cd..ea6e593d9 100644
--- a/lib/pleroma/web/mastodon_api/controllers/account_controller.ex
+++ b/lib/pleroma/web/mastodon_api/controllers/account_controller.ex
@@ -257,6 +257,12 @@ defmodule Pleroma.Web.MastodonAPI.AccountController do
{:error, %Ecto.Changeset{errors: [avatar: {"file is too large", _}]}} ->
render_error(conn, :request_entity_too_large, "File is too large")
+ {:error, %Ecto.Changeset{errors: [banner: {"file is too large", _}]}} ->
+ render_error(conn, :request_entity_too_large, "File is too large")
+
+ {:error, %Ecto.Changeset{errors: [background: {"file is too large", _}]}} ->
+ render_error(conn, :request_entity_too_large, "File is too large")
+
_e ->
render_error(conn, :forbidden, "Invalid request")
end