From de5a5345b6089616c1e379af9b266c53ed30fdfe Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Thu, 31 Mar 2022 10:47:19 +0200 Subject: [PATCH] Don't return error 500 when issue with media proxy Signed-off-by: Thomas Citharel --- lib/web/proxy/reverse_proxy.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/web/proxy/reverse_proxy.ex b/lib/web/proxy/reverse_proxy.ex index 79382f66..7f6bde74 100644 --- a/lib/web/proxy/reverse_proxy.ex +++ b/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