X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fpleroma%2Fweb%2Fendpoint.ex;h=72cb3ee279536954b9aed4cb8b10df93817fb6a9;hb=a92c713d9c761563c72d0f660574878aa569249a;hp=c123530dcf961c10a2dfd5179404c3a43c53613f;hpb=90986667cedb20b316ae4e160729d78d692d0c0e;p=akkoma
diff --git a/lib/pleroma/web/endpoint.ex b/lib/pleroma/web/endpoint.ex
index c123530dc..72cb3ee27 100644
--- a/lib/pleroma/web/endpoint.ex
+++ b/lib/pleroma/web/endpoint.ex
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2019 Pleroma Authors
+# Copyright © 2017-2020 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.Endpoint do
@@ -57,13 +57,16 @@ defmodule Pleroma.Web.Endpoint do
plug(Phoenix.CodeReloader)
end
- plug(TrailingFormatPlug)
+ plug(Pleroma.Plugs.TrailingFormatPlug)
plug(Plug.RequestId)
- plug(Plug.Logger)
-
- plug(
- Plug.Parsers,
- parsers: [:urlencoded, :multipart, :json],
+ plug(Plug.Logger, log: :debug)
+
+ 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]),
@@ -97,10 +100,7 @@ defmodule Pleroma.Web.Endpoint do
extra: extra
)
- # Note: the plug and its configuration is compile-time this can't be upstreamed yet
- if proxies = Pleroma.Config.get([__MODULE__, :reverse_proxies]) do
- plug(RemoteIp, proxies: proxies)
- end
+ plug(Pleroma.Plugs.RemoteIp)
defmodule Instrumenter do
use Prometheus.PhoenixInstrumenter