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 CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{httparty}
5
- s.version = "0.3.2"
5
+ s.version = "0.3.3"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["John Nunemaker"]
@@ -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
- @request.send(:http).use_ssl?.should == false
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kerryb-httparty
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Nunemaker