lib/gitlab/url_blocker.rb
# Returns the given URI with IP address as hostname and the original hostname respectively
# in an Array.
#
# It checks whether the resolved IP address matches with the hostname. If not, it changes
# the hostname to the resolved IP address.
#
# The original hostname is used to validate the SSL, given in that scenario
# we'll be making the request to the IP address, instead of using the hostname.
Returns the given URI with IP address as hostname and the original hostname respectively
in an Array.

It checks whether the resolved IP address matches with the hostname. If not, it changes
the hostname to the resolved IP address.

The original hostname is used to validate the SSL, given in that scenario
we'll be making the request to the IP address, instead of using the hostname.
Returns the given URI with IP address as hostname and the original hostname respectively in an Array . It checks whether the resolved IP address matches with the hostname . If not it changes the hostname to the resolved IP address . The original hostname is used to validate the SSL given in that scenario we ' ll be making the request to the IP address instead of using the hostname .
def enforce_uri_hostname(addrs_info, uri, hostname, dns_rebind_protection)
        address = addrs_info.first
        ip_address = address&.ip_address
        return [uri, nil] unless dns_rebind_protection && ip_address && ip_address != hostname
        uri = uri.dup
        uri.hostname = ip_address
        [uri, hostname]
      end
def enforce_uri_hostname ( addrs_info , uri , hostname , dns_rebind_protection ) address = addrs_info . first ip_address = address &. ip_address return [ uri , nil ] unless dns_rebind_protection && ip_address && ip_address != hostname uri = uri . dup uri . hostname = ip_address [ uri , hostname ] end
Returns the given URI with IP address as hostname and the original hostname respectively
in an Array.
Returns the given URI with IP address as hostname and the original hostname respectively in an Array .
addrs_info
<not_specific>
uri
<not_specific>
hostname
<not_specific>
dns_rebind_protection
<not_specific>