Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/webmock.rb')
-rw-r--r--spec/support/webmock.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/support/webmock.rb b/spec/support/webmock.rb
index b9bd3f82f65..171c7ace2d2 100644
--- a/spec/support/webmock.rb
+++ b/spec/support/webmock.rb
@@ -9,12 +9,26 @@ def webmock_allowed_hosts
hosts << URI.parse(ENV['ELASTIC_URL']).host
end
+ if ENV.key?('ZOEKT_INDEX_BASE_URL')
+ hosts.concat(allowed_host_and_ip(ENV['ZOEKT_INDEX_BASE_URL']))
+ end
+
+ if ENV.key?('ZOEKT_SEARCH_BASE_URL')
+ hosts.concat(allowed_host_and_ip(ENV['ZOEKT_SEARCH_BASE_URL']))
+ end
+
if Gitlab.config.webpack&.dev_server&.enabled
hosts << Gitlab.config.webpack.dev_server.host
end
end.compact.uniq
end
+def allowed_host_and_ip(url)
+ host = URI.parse(url).host
+ ip_address = Addrinfo.ip(host).ip_address
+ [host, ip_address]
+end
+
def with_net_connect_allowed
WebMock.allow_net_connect!
yield