class Middleman::PreviewServer::Checks::ServerNameResolvesToBindAddress
This validation will fail
2. bind_address: 127.0.0.01
1. server_name: www.example.com (10.0.0.1)
If the users enters:
This checks if the server name resolves to the bind_address
def initialize
def initialize @resolver = DnsResolver.new end
def validate(information)
-
information
(Information
) --
def validate(information) return if resolver.ips_for(information.server_name).include? information.bind_address information.valid = false information.reason = format('Server name "%s" does not resolve to bind address "%s"', information.server_name, information.bind_address) end