<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -91,7 +91,7 @@ module OAuth
     #  @request_token=@consumer.get_request_token
     #
     def get_request_token(request_options={}, *arguments)
-      response=token_request(http_method,request_token_url, nil, request_options, *arguments)
+      response=token_request(http_method,(request_token_url? ? request_token_url : request_token_path), nil, request_options, *arguments)
       OAuth::RequestToken.new(self,response[:oauth_token],response[:oauth_token_secret])
     end
     
@@ -103,7 +103,14 @@ module OAuth
     #   @consumer.request(:post,'/people',@token,{},@person.to_xml,{ 'Content-Type' =&gt; 'application/xml' })
     #
     def request(http_method,path, token=nil,request_options={},*arguments)
-      http.request(create_signed_request(http_method,path,token,request_options,*arguments))
+      if path=~/^\//
+        _http=http
+      else
+        _http=create_http(path)
+        _uri=URI.parse(path)
+        path=&quot;#{_uri.path}#{_uri.query ? &quot;?#{_uri.query}&quot; : &quot;&quot;}&quot;
+      end
+      _http.request(create_signed_request(http_method,path,token,request_options,*arguments))
     end
     
     # Creates and signs an http request.
@@ -159,20 +166,37 @@ module OAuth
       @options[:request_token_url]||site+request_token_path
     end
 
+    def request_token_url?
+      @options[:request_token_url]!=nil
+    end
+    
     def authorize_url
       @options[:authorize_url]||site+authorize_path
     end
+    
+    def authorize_url?
+      @options[:authorize_url]!=nil
+    end
 
     def access_token_url
       @options[:access_token_url]||site+access_token_path
     end
 
+    def access_token_url?
+      @options[:access_token_url]!=nil
+    end
+
     protected
     
     #Instantiates the http object
-    def create_http
-      http_object=Net::HTTP.new(uri.host, uri.port)
-      http_object.use_ssl = true if uri.scheme==&quot;https&quot;
+    def create_http(_url=nil)
+      if _url.nil?||_url[0]=~/^\//
+        our_uri=URI.parse(site)
+      else
+        our_uri=URI.parse(_url)
+      end
+      http_object=Net::HTTP.new(our_uri.host, our_uri.port)
+      http_object.use_ssl = true if our_uri.scheme==&quot;https&quot;
       http_object
     end
     </diff>
      <filename>lib/oauth/consumer.rb</filename>
    </modified>
    <modified>
      <diff>@@ -62,7 +62,7 @@ module OAuth
     
     # exchange for AccessToken on server
     def get_access_token(options={})
-      response=consumer.token_request(consumer.http_method,consumer.access_token_url,self,options)
+      response=consumer.token_request(consumer.http_method,(consumer.access_token_url? ? consumer.access_token_url : consumer.access_token_path),self,options)
       OAuth::AccessToken.new(consumer,response[:oauth_token],response[:oauth_token_secret])
     end
   end</diff>
      <filename>lib/oauth/token.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,3 @@
 module OAuth #:nodoc:
-  VERSION = '0.3.0'
+  VERSION = '0.3.1'
 end</diff>
      <filename>lib/oauth/version.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,11 +2,11 @@
 
 Gem::Specification.new do |s|
   s.name = %q{oauth}
-  s.version = &quot;0.3.0&quot;
+  s.version = &quot;0.3.1&quot;
 
   s.required_rubygems_version = Gem::Requirement.new(&quot;&gt;= 0&quot;) if s.respond_to? :required_rubygems_version=
   s.authors = [&quot;Pelle Braendgaard&quot;, &quot;Blaine Cook&quot;, &quot;Larry Halff&quot;, &quot;Jesse Clark&quot;, &quot;Jon Crosby&quot;, &quot;Seth Fitzsimmons&quot;]
-  s.date = %q{2009-01-25}
+  s.date = %q{2009-01-26}
   s.default_executable = %q{oauth}
   s.description = %q{OAuth Core Ruby implementation}
   s.email = %q{pelleb@gmail.com}</diff>
      <filename>oauth.gemspec</filename>
    </modified>
    <modified>
      <diff>@@ -208,6 +208,51 @@ class ConsumerTest &lt; Test::Unit::TestCase
         :access_token_path=&gt;&quot;/oauth/example/access_token.php&quot;,
         :authorize_path=&gt;&quot;/oauth/example/authorize.php&quot;
         })
+    assert_equal &quot;http://term.ie/oauth/example/request_token.php&quot;,@consumer.request_token_url
+    assert_equal &quot;http://term.ie/oauth/example/access_token.php&quot;,@consumer.access_token_url
+
+    assert !@consumer.request_token_url?, &quot;Should not use fully qualified request token url&quot;
+    assert !@consumer.access_token_url?, &quot;Should not use fully qualified access token url&quot;
+    assert !@consumer.authorize_url?, &quot;Should not use fully qualified url&quot;
+
+    @request_token=@consumer.get_request_token
+    assert_not_nil @request_token
+    assert_equal &quot;requestkey&quot;,@request_token.token
+    assert_equal &quot;requestsecret&quot;,@request_token.secret
+    assert_equal &quot;http://term.ie/oauth/example/authorize.php?oauth_token=requestkey&quot;,@request_token.authorize_url
+
+    @access_token=@request_token.get_access_token
+    assert_not_nil @access_token
+    assert_equal &quot;accesskey&quot;,@access_token.token
+    assert_equal &quot;accesssecret&quot;,@access_token.secret
+    
+    @response=@access_token.get(&quot;/oauth/example/echo_api.php?ok=hello&amp;test=this&quot;)
+    assert_not_nil @response
+    assert_equal &quot;200&quot;,@response.code
+    assert_equal( &quot;ok=hello&amp;test=this&quot;,@response.body)
+    
+    @response=@access_token.post(&quot;/oauth/example/echo_api.php&quot;,{'ok'=&gt;'hello','test'=&gt;'this'})
+    assert_not_nil @response
+    assert_equal &quot;200&quot;,@response.code
+    assert_equal( &quot;ok=hello&amp;test=this&quot;,@response.body)    
+  end
+
+  def test_get_token_sequence_using_fqdn
+    @consumer=OAuth::Consumer.new( 
+        &quot;key&quot;,
+        &quot;secret&quot;,
+        {
+        :site=&gt;&quot;http://term.ie&quot;,
+        :request_token_url=&gt;&quot;http://term.ie/oauth/example/request_token.php&quot;,
+        :access_token_url=&gt;&quot;http://term.ie/oauth/example/access_token.php&quot;,
+        :authorize_url=&gt;&quot;http://term.ie/oauth/example/authorize.php&quot;
+        })
+    assert_equal &quot;http://term.ie/oauth/example/request_token.php&quot;,@consumer.request_token_url
+    assert_equal &quot;http://term.ie/oauth/example/access_token.php&quot;,@consumer.access_token_url
+
+    assert @consumer.request_token_url?, &quot;Should use fully qualified request token url&quot;
+    assert @consumer.access_token_url?, &quot;Should use fully qualified access token url&quot;
+    assert @consumer.authorize_url?, &quot;Should use fully qualified url&quot;
     
     @request_token=@consumer.get_request_token
     assert_not_nil @request_token</diff>
      <filename>test/test_consumer.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>6653f5394fc16eebd3d581e5004a44b6e16e9169</id>
    </parent>
  </parents>
  <author>
    <name>Pelle Braendgaard</name>
    <email>pelleb@gmail.com</email>
  </author>
  <url>http://github.com/jcrosby/oauth/commit/af01033fef86e10e8a2de8b6842fec4021388756</url>
  <id>af01033fef86e10e8a2de8b6842fec4021388756</id>
  <committed-date>2009-01-26T12:27:51-08:00</committed-date>
  <authored-date>2009-01-26T12:27:51-08:00</authored-date>
  <message>Fixed a problem with absolute and relative urls in token paths found by Michael Wood.</message>
  <tree>c22eeb7542f5de9fe2da57e58f473840460ffc2f</tree>
  <committer>
    <name>Pelle Braendgaard</name>
    <email>pelleb@gmail.com</email>
  </committer>
</commit>
