From bf16cd3e6a5b22bbe36f02240a3a6f7fdc7a9c08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Tue, 20 Jun 2023 11:20:02 +0200 Subject: [PATCH] Translate 0.0.0.0 to localhost (#1992) Closes #1991. --- lib/livebook/utils.ex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/livebook/utils.ex b/lib/livebook/utils.ex index 713d797ec..4f957f0b9 100644 --- a/lib/livebook/utils.ex +++ b/lib/livebook/utils.ex @@ -549,12 +549,13 @@ defmodule Livebook.Utils do "localhost" iex> Livebook.Utils.ip_to_host({0, 0, 0, 0}) - "0.0.0.0" + "localhost" """ @spec ip_to_host(:inet.ip_address()) :: String.t() def ip_to_host(ip) + def ip_to_host({0, 0, 0, 0}), do: "localhost" def ip_to_host({127, 0, 0, 1}), do: "localhost" def ip_to_host(ip) do