Don't return error 500 when issue with media proxy

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
chapril
Thomas Citharel 6 months ago
parent a49bda5e4c
commit de5a5345b6
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773
  1. 4
      lib/web/proxy/reverse_proxy.ex

@ -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

Loading…
Cancel
Save