kerryb-httparty 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- data/httparty.gemspec +1 -1
- data/lib/httparty/request.rb +1 -1
- data/spec/httparty/request_spec.rb +6 -1
- metadata +1 -1
data/httparty.gemspec
CHANGED
data/lib/httparty/request.rb
CHANGED
@@ -43,7 +43,7 @@ module HTTParty
|
|
43
43
|
private
|
44
44
|
def http
|
45
45
|
http = Net::HTTP.new(uri.host, uri.port, options[:http_proxyaddr], options[:http_proxyport])
|
46
|
-
http.use_ssl = (uri.port == 443)
|
46
|
+
http.use_ssl = (uri.port == 443 || uri.scheme == 'https')
|
47
47
|
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
48
48
|
http
|
49
49
|
end
|
@@ -33,7 +33,12 @@ describe HTTParty::Request do
|
|
33
33
|
|
34
34
|
it 'should not use ssl for port 80' do
|
35
35
|
request = HTTParty::Request.new(Net::HTTP::Get, 'http://foobar.com')
|
36
|
-
|
36
|
+
request.send(:http).use_ssl?.should == false
|
37
|
+
end
|
38
|
+
|
39
|
+
it 'should use ssl for https scheme' do
|
40
|
+
request = HTTParty::Request.new(Net::HTTP::Get, 'https://foobar.com')
|
41
|
+
request.send(:http).use_ssl?.should == true
|
37
42
|
end
|
38
43
|
|
39
44
|
it "should use basic auth when configured" do
|