incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Browning <bbrow...@redhat.com>
Subject [PATCH 1/2] Fix authorization header encoding under JRuby
Date Wed, 25 Aug 2010 19:07:30 GMT
---
 client/lib/deltacloud.rb |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/client/lib/deltacloud.rb b/client/lib/deltacloud.rb
index f8f3cd7..71b0c97 100644
--- a/client/lib/deltacloud.rb
+++ b/client/lib/deltacloud.rb
@@ -387,8 +387,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
-- 
1.7.2.1


Mime
View raw message