Method: Hub::GitHubAPI::HttpMethods#configure_connection
- Defined in:
- lib/hub/github_api.rb
#configure_connection(req, url) {|url| ... } ⇒ Object
253 254 255 256 257 258 259 260 261 262 263 264 |
# File 'lib/hub/github_api.rb', line 253 def configure_connection req, url url.scheme = config.protocol(url.host) if ENV['HUB_TEST_HOST'] req['Host'] = url.host req['X-Original-Scheme'] = url.scheme url = url.dup url.scheme = 'http' url.host, test_port = ENV['HUB_TEST_HOST'].split(':') url.port = test_port.to_i if test_port end yield url end |