mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-23 00:26:30 +00:00
Pleroma.Web.MediaProxy.MediaProxyController: dialyzer errors
lib/pleroma/web/media_proxy/media_proxy_controller.ex:55:no_return Function handle_preview/2 has no local return. ________________________________________________________________________________ lib/pleroma/web/media_proxy/media_proxy_controller.ex:59:call The function call will not succeed. Pleroma.HTTP.request(<<72, 69, 65, 68>>, _media_proxy_url :: any(), [], [], [{:pool, :media}]) will never return since the success typing is: ( :delete | :get | :head | :options | :patch | :post | :put | :trace, binary(), any(), [{binary(), binary()}], Keyword.t() ) :: any() and the contract is ( method(), Pleroma.HTTP.Request.url(), String.t(), Pleroma.HTTP.Request.headers(), :elixir.keyword() ) :: {:ok, Tesla.Env.t()} | {:error, any()} ________________________________________________________________________________ lib/pleroma/web/media_proxy/media_proxy_controller.ex:95:unused_fun Function handle_preview/3 will never be called. ________________________________________________________________________________ lib/pleroma/web/media_proxy/media_proxy_controller.ex:111:unused_fun Function handle_png_preview/2 will never be called. ________________________________________________________________________________ lib/pleroma/web/media_proxy/media_proxy_controller.ex:134:unused_fun Function handle_jpeg_preview/2 will never be called. ________________________________________________________________________________ lib/pleroma/web/media_proxy/media_proxy_controller.ex:152:unused_fun Function handle_video_preview/2 will never be called. ________________________________________________________________________________ lib/pleroma/web/media_proxy/media_proxy_controller.ex:164:unused_fun Function drop_static_param_and_redirect/1 will never be called. ________________________________________________________________________________ lib/pleroma/web/media_proxy/media_proxy_controller.ex:173:unused_fun Function fallback_on_preview_error/2 will never be called. ________________________________________________________________________________ lib/pleroma/web/media_proxy/media_proxy_controller.ex:177:unused_fun Function put_preview_response_headers/1 will never be called. ________________________________________________________________________________ lib/pleroma/web/media_proxy/media_proxy_controller.ex:177:unused_fun Function put_preview_response_headers/2 will never be called. ________________________________________________________________________________ lib/pleroma/web/media_proxy/media_proxy_controller.ex:187:unused_fun Function thumbnail_max_dimensions/0 will never be called. ________________________________________________________________________________ lib/pleroma/web/media_proxy/media_proxy_controller.ex:196:unused_fun Function min_content_length_for_preview/0 will never be called. ________________________________________________________________________________ lib/pleroma/web/media_proxy/media_proxy_controller.ex:200:unused_fun Function media_preview_proxy_config/0 will never be called.
This commit is contained in:
parent
8cd5279857
commit
b666710574
2 changed files with 10 additions and 10 deletions
|
@ -56,7 +56,7 @@ defmodule Pleroma.Web.MediaProxy.MediaProxyController do
|
|||
media_proxy_url = MediaProxy.url(url)
|
||||
|
||||
with {:ok, %{status: status} = head_response} when status in 200..299 <-
|
||||
Pleroma.HTTP.request("HEAD", media_proxy_url, [], [], pool: :media) do
|
||||
Pleroma.HTTP.request(:head, media_proxy_url, "", [], pool: :media) do
|
||||
content_type = Tesla.get_header(head_response, "content-type")
|
||||
content_length = Tesla.get_header(head_response, "content-length")
|
||||
content_length = content_length && String.to_integer(content_length)
|
||||
|
|
|
@ -182,7 +182,7 @@ defmodule Pleroma.Web.MediaProxy.MediaProxyControllerTest do
|
|||
media_proxy_url: media_proxy_url
|
||||
} do
|
||||
Tesla.Mock.mock(fn
|
||||
%{method: "HEAD", url: ^media_proxy_url} ->
|
||||
%{method: :head, url: ^media_proxy_url} ->
|
||||
%Tesla.Env{status: 500, body: ""}
|
||||
end)
|
||||
|
||||
|
@ -197,7 +197,7 @@ defmodule Pleroma.Web.MediaProxy.MediaProxyControllerTest do
|
|||
media_proxy_url: media_proxy_url
|
||||
} do
|
||||
Tesla.Mock.mock(fn
|
||||
%{method: "HEAD", url: ^media_proxy_url} ->
|
||||
%{method: :head, url: ^media_proxy_url} ->
|
||||
%Tesla.Env{status: 200, body: "", headers: [{"content-type", "application/pdf"}]}
|
||||
end)
|
||||
|
||||
|
@ -217,7 +217,7 @@ defmodule Pleroma.Web.MediaProxy.MediaProxyControllerTest do
|
|||
clear_config([:media_preview_proxy, :min_content_length], 1_000_000_000)
|
||||
|
||||
Tesla.Mock.mock(fn
|
||||
%{method: "HEAD", url: ^media_proxy_url} ->
|
||||
%{method: :head, url: ^media_proxy_url} ->
|
||||
%Tesla.Env{
|
||||
status: 200,
|
||||
body: "",
|
||||
|
@ -242,7 +242,7 @@ defmodule Pleroma.Web.MediaProxy.MediaProxyControllerTest do
|
|||
media_proxy_url: media_proxy_url
|
||||
} do
|
||||
Tesla.Mock.mock(fn
|
||||
%{method: "HEAD", url: ^media_proxy_url} ->
|
||||
%{method: :head, url: ^media_proxy_url} ->
|
||||
%Tesla.Env{status: 200, body: "", headers: [{"content-type", "image/gif"}]}
|
||||
end)
|
||||
|
||||
|
@ -260,7 +260,7 @@ defmodule Pleroma.Web.MediaProxy.MediaProxyControllerTest do
|
|||
media_proxy_url: media_proxy_url
|
||||
} do
|
||||
Tesla.Mock.mock(fn
|
||||
%{method: "HEAD", url: ^media_proxy_url} ->
|
||||
%{method: :head, url: ^media_proxy_url} ->
|
||||
%Tesla.Env{status: 200, body: "", headers: [{"content-type", "image/jpeg"}]}
|
||||
end)
|
||||
|
||||
|
@ -280,7 +280,7 @@ defmodule Pleroma.Web.MediaProxy.MediaProxyControllerTest do
|
|||
clear_config([:media_preview_proxy, :min_content_length], 100_000)
|
||||
|
||||
Tesla.Mock.mock(fn
|
||||
%{method: "HEAD", url: ^media_proxy_url} ->
|
||||
%{method: :head, url: ^media_proxy_url} ->
|
||||
%Tesla.Env{
|
||||
status: 200,
|
||||
body: "",
|
||||
|
@ -302,7 +302,7 @@ defmodule Pleroma.Web.MediaProxy.MediaProxyControllerTest do
|
|||
assert_dependencies_installed()
|
||||
|
||||
Tesla.Mock.mock(fn
|
||||
%{method: "HEAD", url: ^media_proxy_url} ->
|
||||
%{method: :head, url: ^media_proxy_url} ->
|
||||
%Tesla.Env{status: 200, body: "", headers: [{"content-type", "image/png"}]}
|
||||
|
||||
%{method: :get, url: ^media_proxy_url} ->
|
||||
|
@ -324,7 +324,7 @@ defmodule Pleroma.Web.MediaProxy.MediaProxyControllerTest do
|
|||
assert_dependencies_installed()
|
||||
|
||||
Tesla.Mock.mock(fn
|
||||
%{method: "HEAD", url: ^media_proxy_url} ->
|
||||
%{method: :head, url: ^media_proxy_url} ->
|
||||
%Tesla.Env{status: 200, body: "", headers: [{"content-type", "image/jpeg"}]}
|
||||
|
||||
%{method: :get, url: ^media_proxy_url} ->
|
||||
|
@ -344,7 +344,7 @@ defmodule Pleroma.Web.MediaProxy.MediaProxyControllerTest do
|
|||
media_proxy_url: media_proxy_url
|
||||
} do
|
||||
Tesla.Mock.mock(fn
|
||||
%{method: "HEAD", url: ^media_proxy_url} ->
|
||||
%{method: :head, url: ^media_proxy_url} ->
|
||||
%Tesla.Env{status: 200, body: "", headers: [{"content-type", "image/jpeg"}]}
|
||||
|
||||
%{method: :get, url: ^media_proxy_url} ->
|
||||
|
|
Loading…
Reference in a new issue