Don't return error 500 when issue with media proxy
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
a49bda5e4c
commit
de5a5345b6
@ -131,7 +131,7 @@ defmodule Mobilizon.Web.ReverseProxy do
|
|||||||
Logger.warn("Tried to reverse proxy URL #{inspect(url)}")
|
Logger.warn("Tried to reverse proxy URL #{inspect(url)}")
|
||||||
|
|
||||||
conn
|
conn
|
||||||
|> error_or_redirect(url, 500, "Request failed", opts)
|
|> error_or_redirect(url, 400, "Request failed", opts)
|
||||||
|> halt()
|
|> halt()
|
||||||
|
|
||||||
{:error, {:invalid_http_response, code}} ->
|
{:error, {:invalid_http_response, code}} ->
|
||||||
@ -150,7 +150,7 @@ defmodule Mobilizon.Web.ReverseProxy do
|
|||||||
Logger.error("#{__MODULE__}: request to #{inspect(url)} failed: #{inspect(error)}")
|
Logger.error("#{__MODULE__}: request to #{inspect(url)} failed: #{inspect(error)}")
|
||||||
|
|
||||||
conn
|
conn
|
||||||
|> error_or_redirect(url, 500, "Request failed", opts)
|
|> error_or_redirect(url, 400, "Request failed", opts)
|
||||||
|> halt()
|
|> halt()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user