logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git

multipart.ex (677B)


  1. # Pleroma: A lightweight social networking server
  2. # Copyright © 2017-2023 Pleroma Authors <https://pleroma.social/>
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. # <https://hexdocs.pm/plug/Plug.Parsers.MULTIPART.html#module-dynamic-configuration>
  5. defmodule Pleroma.Web.Multipart do
  6. @multipart Plug.Parsers.MULTIPART
  7. def init(opts) do
  8. opts
  9. end
  10. def parse(conn, "multipart", subtype, headers, opts) do
  11. length = Pleroma.Config.get([:instance, :upload_limit])
  12. opts = @multipart.init([length: length] ++ opts)
  13. @multipart.parse(conn, "multipart", subtype, headers, opts)
  14. end
  15. def parse(conn, _type, _subtype, _headers, _opts) do
  16. {:next, conn}
  17. end
  18. end