fix HTTPS requests should go to port 443 if none specified

This commit is contained in:
Mislav Marohnić 2011-03-14 16:54:46 +01:00
parent 41afcc86e7
commit 7d277ef563
2 changed files with 2 additions and 2 deletions

View File

@ -41,7 +41,7 @@ module Faraday
uri = Addressable::URI.parse(proxy[:uri])
options[:proxy] = {
:host => uri.host,
:port => uri.port
:port => uri.inferred_port
}
if proxy[:username] && proxy[:password]
options[:proxy][:authorization] = [proxy[:username], proxy[:password]]

View File

@ -13,7 +13,7 @@ module Faraday
url = env[:url]
req = env[:request]
http = net_http_class(env).new(url.host, url.port)
http = net_http_class(env).new(url.host, url.inferred_port)
if http.use_ssl = (url.scheme == 'https' && env[:ssl])
ssl = env[:ssl]