<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -33,8 +33,6 @@ module HTTParty
 
     def base_uri(base_uri=nil)
       return @base_uri unless base_uri
-      # don't want this to ever end with /
-      base_uri = base_uri.ends_with?('/') ? base_uri.chop : base_uri
       @base_uri = normalize_base_uri(base_uri)
     end
     
@@ -150,14 +148,16 @@ module HTTParty
         when :json
           ActiveSupport::JSON.decode(body)
         else
-          # just return the response if no format 
           body
         end
       end
     
       # Makes it so uri is sure to parse stuff like google.com with the http
-      def normalize_base_uri(str) #:nodoc:
-        str =~ /^https?:\/\// ? str : &quot;http#{'s' if str.include?(':443')}://#{str}&quot;
+      def normalize_base_uri(url) #:nodoc:
+        use_ssl = (url =~ /^https/) || url.include?(':443')
+        url.chop! if url.ends_with?('/')
+        url.gsub!(/^https?:\/\//i, '')
+        &quot;http#{'s' if use_ssl}://#{url}&quot;
       end
       
       # Uses the HTTP Content-Type header to determine the format of the response</diff>
      <filename>lib/httparty.rb</filename>
    </modified>
    <modified>
      <diff>@@ -13,11 +13,11 @@ end
 describe HTTParty do
   
   describe &quot;base uri&quot; do
-    it &quot;should be gettable&quot; do
+    it &quot;should have reader&quot; do
       Foo.base_uri.should == 'http://api.foo.com/v1'
     end
     
-    it 'should be setable' do
+    it 'should have writer' do
       Foo.base_uri('http://api.foobar.com')
       Foo.base_uri.should == 'http://api.foobar.com'
     end
@@ -28,7 +28,13 @@ describe HTTParty do
     end
     
     it &quot;should add https if not present for ssl requests&quot; do
-      FooWithHttps.base_uri.should == 'https://api.foo.com/v1:443'
+      Foo.base_uri('api.foo.com/v1:443')
+      Foo.base_uri.should == 'https://api.foo.com/v1:443'
+    end
+    
+    it &quot;should not remove https for ssl requests&quot; do
+      Foo.base_uri('https://api.foo.com/v1:443')
+      Foo.base_uri.should == 'https://api.foo.com/v1:443'
     end
   end
   </diff>
      <filename>spec/httparty_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>spec/hash_spec.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>3101b5318b9476a9c7937f86581cddb623c820ee</id>
    </parent>
  </parents>
  <author>
    <name>John Nunemaker</name>
    <email>nunemaker@gmail.com</email>
  </author>
  <url>http://github.com/jnunemaker/httparty/commit/bcc38bcf32218e3a7c5d754582b1c04002f0119b</url>
  <id>bcc38bcf32218e3a7c5d754582b1c04002f0119b</id>
  <committed-date>2008-11-08T08:18:25-08:00</committed-date>
  <authored-date>2008-11-08T08:18:25-08:00</authored-date>
  <message>Cleaned up base uri normalization.</message>
  <tree>d30c53f2fbab5817477694fb20dedf3557a40cd0</tree>
  <committer>
    <name>John Nunemaker</name>
    <email>nunemaker@gmail.com</email>
  </committer>
</commit>
