Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit 9c08f47bcb7d3d087669c4434d158b6f1c7ab525 2 parents e7a4aaa + a296b1c
@jnunemaker authored
Showing with 6 additions and 1 deletion.
  1. +1 −1  lib/httparty.rb
  2. +5 −0 spec/httparty_spec.rb
View
2  lib/httparty.rb
@@ -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
5 spec/httparty_spec.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.