When WebMock.disallow_net_connect! is called with:
WebMock.disallow_net_connect!(allow: ['https://github.com/mozilla/geckodriver/releases/latest'])
it fails to allow requests to that url because the uri that comes into net_connect_explicit_allowed? is an Addressable::URI, who's #to_s method returns a string with the port in.
For example:
require 'webmock'
allowed = "https://github.com/mozilla/geckodriver/releases/latest"
uri = WebMock::Util::URI.normalize_uri(allowed)
puts uri.class
# Addressable::URI
puts uri.to_s
# https://github.com:443/mozilla/geckodriver/releases/latest
puts allowed == uri.to_s ||
allowed == uri.host ||
allowed == "#{uri.host}:#{uri.port}" ||
allowed == "#{uri.scheme}://#{uri.host}:#{uri.port}" ||
allowed == "#{uri.scheme}://#{uri.host}" && uri.port == uri.default_port
# false
FYI such requests happen automatically in capybara/selenium-webdriver/webdrivers when using firefox driver.
When
WebMock.disallow_net_connect!is called with:it fails to allow requests to that url because the uri that comes into
net_connect_explicit_allowed?is anAddressable::URI, who's#to_smethod returns a string with the port in.For example:
FYI such requests happen automatically in capybara/selenium-webdriver/webdrivers when using firefox driver.