Refactor Mobilizon.Federation.ActivityPub and add typespecs

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2021-09-28 19:40:37 +02:00
parent 41f086e2c9
commit b5d9b82bdd
125 changed files with 2497 additions and 1673 deletions

View File

@@ -21,6 +21,7 @@ defmodule Mobilizon.Web.Plugs.UploadedMedia do
# no slashes
@path "media"
@spec init(any()) :: map()
def init(_opts) do
static_plug_opts =
[]
@@ -31,6 +32,7 @@ defmodule Mobilizon.Web.Plugs.UploadedMedia do
%{static_plug_opts: static_plug_opts}
end
@spec call(Plug.Conn.t(), map()) :: Plug.Conn.t()
def call(%{request_path: <<"/", @path, "/", file::binary>>} = conn, opts) do
conn =
case fetch_query_params(conn) do