mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2026-02-15 17:16:57 +00:00
warning: a struct for Plug.Upload is expected on struct update:
%Plug.Upload{image | filename: "../../../../../nested/file.jpg"}
but got type:
dynamic()
where "image" was given the type:
# type: dynamic()
# from: test/pleroma/web/mastodon_api/controllers/media_controller_test.exs:132:42
%{conn: conn, image: image}
when defining the variable "image", you must also pattern match on "%Plug.Upload{}".
hint: given pattern matching is enough to catch typing errors, you may optionally convert the struct update into a map update. For example, instead of:
user = some_function()
%User{user | name: "John Doe"}
it is enough to write:
%User{} = user = some_function()
%{user | name: "John Doe"}
typing violation found at:
│
133 │ image = %Plug.Upload{
│ ~
│
└─ test/pleroma/web/mastodon_api/controllers/media_controller_test.exs:133:15: Pleroma.Web.MastodonAPI.MediaControllerTest."test Upload media Do not allow nested filename"/1
|
||
|---|---|---|
| .. | ||
| config | ||
| credo/check/consistency | ||
| fixtures | ||
| instance_static | ||
| mix | ||
| pleroma | ||
| support | ||
| test_helper.exs | ||