summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancisco Javier López <fjlopez@gitlab.com>2019-07-29 21:35:10 +0200
committerFrancisco Javier López <fjlopez@gitlab.com>2019-07-29 21:35:10 +0200
commit77a1ca63d8dd301bfeed03d66bc0f78bf22b9b76 (patch)
treeed68282b03ed283d551acdfb012c6f5962d77484
parentb6b9ccbb335950342589d450ad794a02da045a8a (diff)
downloadgitlab-ce-fj-fix-broken-master-url-blocker.tar.gz
Fix broken master because of security mergefj-fix-broken-master-url-blocker
-rw-r--r--lib/gitlab/url_blocker.rb7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/gitlab/url_blocker.rb b/lib/gitlab/url_blocker.rb
index aac96377152..9c35d200dcb 100644
--- a/lib/gitlab/url_blocker.rb
+++ b/lib/gitlab/url_blocker.rb
@@ -86,11 +86,8 @@ module Gitlab
#
# 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 != hostname
+ def enforce_uri_hostname(ip_address, uri, hostname, dns_rebind_protection)
+ return [uri, nil] unless dns_rebind_protection && ip_address && ip_address != hostname
uri = uri.dup
uri.hostname = ip_address