Permalink
Browse files

Do not treat uri's with a port of 4430 as SSL.

  • Loading branch information...
1 parent e7a4aaa commit a296b1c97f83d7dcc6ef85720a43664c265685ac @ntalbott ntalbott committed May 4, 2012
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 a296b1c

Please sign in to comment.