aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/endpoint.ex
diff options
context:
space:
mode:
authorrinpatch <rinpatch@sdf.org>2020-02-07 19:21:55 +0300
committerrinpatch <rinpatch@sdf.org>2020-02-07 20:14:06 +0300
commit15ea75cd2aa649a3d2db2ccd569e679c2433b6cb (patch)
tree52c4af15b2e4cab90587b79bf520d66954c060ad /lib/pleroma/web/endpoint.ex
parentf57cea17bca012569f71d1498fa6e6fa230b4ce0 (diff)
downloadpleroma-15ea75cd2aa649a3d2db2ccd569e679c2433b6cb.tar.gz
Actually fix upload limit on OTP releases
Closes #1109
Diffstat (limited to 'lib/pleroma/web/endpoint.ex')
-rw-r--r--lib/pleroma/web/endpoint.ex12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/pleroma/web/endpoint.ex b/lib/pleroma/web/endpoint.ex
index d32c38a05..a77b73109 100644
--- a/lib/pleroma/web/endpoint.ex
+++ b/lib/pleroma/web/endpoint.ex
@@ -61,7 +61,17 @@ defmodule Pleroma.Web.Endpoint do
plug(Plug.RequestId)
plug(Plug.Logger, log: :debug)
- plug(Pleroma.Plugs.Parsers)
+ plug(Plug.Parsers,
+ parsers: [
+ :urlencoded,
+ {:multipart, length: {Pleroma.Config, :get, [[:instance, :upload_limit]]}},
+ :json
+ ],
+ pass: ["*/*"],
+ json_decoder: Jason,
+ length: Pleroma.Config.get([:instance, :upload_limit]),
+ body_reader: {Pleroma.Web.Plugs.DigestPlug, :read_body, []}
+ )
plug(Plug.MethodOverride)
plug(Plug.Head)