<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -18,6 +18,10 @@ module Videojuicer
 
     class RequestProxy
       
+      # Requests to the following ports will not include the port in the signature base string.
+      # See OAuth spec 1.0a section 9.1.2 for details.
+      EXCLUDED_BASE_STRING_PORTS = [80, 443].freeze
+      
       include Videojuicer::Exceptions
       include Videojuicer::Configurable
             
@@ -218,7 +222,17 @@ module Videojuicer
       # Returns the unencrypted signature base string for this proxy object and the 
       # given request properties.
       def signature_base_string(method, path, params)
-        s = [method.to_s.upcase, &quot;#{protocol}://#{host}#{path}&quot;, normalize_params(params)].collect {|e| CGI.rfc3986_escape(e)}.join(&quot;&amp;&quot;)
+        s = [method.to_s.upcase, &quot;#{protocol}://#{signature_base_string_host}#{path}&quot;, normalize_params(params)].collect {|e| CGI.rfc3986_escape(e)}.join(&quot;&amp;&quot;)
+      end
+      
+      def signature_base_string_host
+        if EXCLUDED_BASE_STRING_PORTS.include?(port.to_i)
+          # Natural port. Ignore the port
+          host
+        else
+          # Weird port. Expect a signature.
+          &quot;#{host}:#{port}&quot;
+        end
       end
       
       # Returns a string representing a normalised parameter hash. Supports nesting for</diff>
      <filename>lib/videojuicer/oauth/request_proxy.rb</filename>
    </modified>
    <modified>
      <diff>@@ -33,7 +33,7 @@ describe Videojuicer::OAuth::RequestProxy do
       @proxy.normalize_params(:a=&gt;&quot;1&quot;, :b=&gt;&quot;2&quot;, :c=&gt;{:a=&gt;&quot;AAA&quot;, :b=&gt;&quot;BBB&quot;, :c=&gt;&quot;CCC&quot;}, :d=&gt;{:e=&gt;&quot;foo&quot;}).should == &quot;a=1&amp;b=2&amp;c%5Ba%5D=AAA&amp;c%5Bb%5D=BBB&amp;c%5Bc%5D=CCC&amp;d%5Be%5D=foo&quot;
     end    
     it &quot;escapes the signature base string elements and adjoins them with an ampersand&quot; do
-      @proxy.signature_base_string(:get, &quot;/test&quot;, :foo=&gt;&quot;bar&quot;, :bar=&gt;&quot;baz&quot;).should == &quot;GET&amp;#{CGI.rfc3986_escape &quot;http://localhost/test&quot;}&amp;#{CGI.rfc3986_escape &quot;bar=baz&amp;foo=bar&quot;}&quot;
+      @proxy.signature_base_string(:get, &quot;/test&quot;, :foo=&gt;&quot;bar&quot;, :bar=&gt;&quot;baz&quot;).should == &quot;GET&amp;#{CGI.rfc3986_escape &quot;http://localhost:6666/test&quot;}&amp;#{CGI.rfc3986_escape &quot;bar=baz&amp;foo=bar&quot;}&quot;
     end
         
     describe &quot;with no token supplied&quot; do</diff>
      <filename>spec/request_proxy_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,11 +5,11 @@
 
 Gem::Specification.new do |s|
   s.name = %q{vj-sdk}
-  s.version = &quot;0.1.15&quot;
+  s.version = &quot;0.2.0&quot;
 
   s.required_rubygems_version = Gem::Requirement.new(&quot;&gt;= 0&quot;) if s.respond_to? :required_rubygems_version=
   s.authors = [&quot;danski&quot;, &quot;thejohnny&quot;, &quot;knowtheory&quot;, &quot;sixones&quot;, &quot;btab&quot;]
-  s.date = %q{2009-10-07}
+  s.date = %q{2009-10-15}
   s.email = %q{dan@videojuicer.com}
   s.extra_rdoc_files = [
     &quot;LICENSE&quot;,</diff>
      <filename>vj-sdk.gemspec</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>6d2773f1bfc71f1c263ed9657a6c69c2b1f7363e</id>
    </parent>
  </parents>
  <author>
    <name>Daniel Glegg</name>
    <email>danski@Jet-Jaguar.local</email>
  </author>
  <url>http://github.com/videojuicer/core-sdk/commit/616ca0bfacd6f06aa48c7780e6b0c400ab089aab</url>
  <id>616ca0bfacd6f06aa48c7780e6b0c400ab089aab</id>
  <committed-date>2009-10-15T08:18:40-07:00</committed-date>
  <authored-date>2009-10-15T08:18:40-07:00</authored-date>
  <message>fix for OAuth proxy not properly including non-standard ports in the base signature string. version bump. gem rebuild.</message>
  <tree>e3191fe146daac4e0783b54d6c8b11a11bfb2951</tree>
  <committer>
    <name>Daniel Glegg</name>
    <email>danski@Jet-Jaguar.local</email>
  </committer>
</commit>
