mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-11-08 05:04:46 +08:00
Update hostname resolution check (#628)
This commit is contained in:
parent
39f1b9b298
commit
e2e9c95880
1 changed files with 6 additions and 2 deletions
|
|
@ -88,8 +88,12 @@ defmodule Livebook.Application do
|
|||
invalid_hostname!("your hostname \"#{hostname}\" does not resolve to an IP address")
|
||||
|
||||
{:ok, hostent(h_addrtype: :inet, h_addr_list: addresses)} ->
|
||||
if {127, 0, 0, 1} not in addresses do
|
||||
invalid_hostname!("your hostname \"#{hostname}\" does not resolve to 127.0.0.1")
|
||||
any_loopback? = Enum.any?(addresses, &match?({127, _, _, _}, &1))
|
||||
|
||||
unless any_loopback? do
|
||||
invalid_hostname!(
|
||||
"your hostname \"#{hostname}\" does not resolve to a loopback address (127.0.0.0/8)"
|
||||
)
|
||||
end
|
||||
|
||||
_ ->
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue