fix(api): allow localhost as a valid uri host for applications

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2023-11-30 09:45:25 +01:00
parent f81804d57f
commit 49b070d939
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773

View file

@ -426,7 +426,7 @@ defmodule Mobilizon.Web.ApplicationController do
defp valid_uri?(url) do defp valid_uri?(url) do
uri = URI.parse(url) uri = URI.parse(url)
uri.scheme != nil and uri.host =~ "." uri.scheme != nil and (uri.host =~ "." or uri.host == "localhost")
end end
@spec append_parameters(String.t(), Enum.t()) :: String.t() @spec append_parameters(String.t(), Enum.t()) :: String.t()