Don't return error 500 when issue with media proxy

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2022-03-31 10:47:19 +02:00
parent a49bda5e4c
commit de5a5345b6
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773

View file

@ -131,7 +131,7 @@ defmodule Mobilizon.Web.ReverseProxy do
Logger.warn("Tried to reverse proxy URL #{inspect(url)}")
conn
|> error_or_redirect(url, 500, "Request failed", opts)
|> error_or_redirect(url, 400, "Request failed", opts)
|> halt()
{:error, {:invalid_http_response, code}} ->
@ -150,7 +150,7 @@ defmodule Mobilizon.Web.ReverseProxy do
Logger.error("#{__MODULE__}: request to #{inspect(url)} failed: #{inspect(error)}")
conn
|> error_or_redirect(url, 500, "Request failed", opts)
|> error_or_redirect(url, 400, "Request failed", opts)
|> halt()
end
end