Permalink
Browse files

Merge pull request #138 from ntalbott/ssl-port-fix

Do not treat uri's with a port of 4430 as SSL.
  • Loading branch information...
jnunemaker committed May 5, 2012
2 parents e7a4aaa + a296b1c commit 9c08f47bcb7d3d087669c4434d158b6f1c7ab525
Showing with 6 additions and 1 deletion.
  1. +1 −1 lib/httparty.rb
  2. +5 −0 spec/httparty_spec.rb
View
@@ -415,7 +415,7 @@ def validate_format
def self.normalize_base_uri(url) #:nodoc:
normalized_url = url.dup
- use_ssl = (normalized_url =~ /^https/) || normalized_url.include?(':443')
+ use_ssl = (normalized_url =~ /^https/) || (normalized_url =~ /:443\b/)
ends_with_slash = normalized_url =~ /\/$/
normalized_url.chop! if ends_with_slash
View
@@ -103,6 +103,11 @@
HTTParty.normalize_base_uri(uri)
uri.should == 'http://api.foobar.com'
end
+
+ it "should not treat uri's with a port of 4430 as ssl" do
+ uri = HTTParty.normalize_base_uri('http://api.foo.com:4430/v1')
+ uri.should == 'http://api.foo.com:4430/v1'
+ end
end
describe "headers" do

0 comments on commit 9c08f47

Please sign in to comment.