diff options
author | duponin <duponin@locahlo.st> | 2022-12-11 23:15:08 +0100 |
---|---|---|
committer | duponin <duponin@locahlo.st> | 2022-12-11 23:15:08 +0100 |
commit | 987674235814205344d320c0e4c21df17b1cdd15 (patch) | |
tree | f20a6701c3b5d3051ed68576069515131fcc9d0b /lib | |
parent | 452595baeda8327b862d03e450ac004679efe86e (diff) | |
download | pleroma-987674235814205344d320c0e4c21df17b1cdd15.tar.gz pleroma-987674235814205344d320c0e4c21df17b1cdd15.zip |
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.ex | 6 |
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 |