You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by lu...@apache.org on 2010/09/23 00:14:33 UTC

svn commit: r1000259 - /incubator/deltacloud/trunk/client/lib/deltacloud.rb

Author: lutter
Date: Wed Sep 22 22:14:32 2010
New Revision: 1000259

URL: http://svn.apache.org/viewvc?rev=1000259&view=rev
Log:
Fix authorization header encoding under JRuby

Modified:
    incubator/deltacloud/trunk/client/lib/deltacloud.rb

Modified: incubator/deltacloud/trunk/client/lib/deltacloud.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/client/lib/deltacloud.rb?rev=1000259&r1=1000258&r2=1000259&view=diff
==============================================================================
--- incubator/deltacloud/trunk/client/lib/deltacloud.rb (original)
+++ incubator/deltacloud/trunk/client/lib/deltacloud.rb Wed Sep 22 22:14:32 2010
@@ -403,8 +403,12 @@ module DeltaCloud
     private
 
     def default_headers
+      # The linebreaks inserted every 60 characters in the Base64
+      # encoded header cause problems under JRuby
+      auth_header = "Basic "+Base64.encode64("#{@username}:#{@password}")
+      auth_header.gsub!("\n", "")
       {
-        :authorization => "Basic "+Base64.encode64("#{@username}:#{@password}"),
+        :authorization => auth_header,
         :accept => "application/xml"
       }
     end