From 92ff7121ec656b36815b14533fba5e92c165eb08 Mon Sep 17 00:00:00 2001 From: luke Date: Wed, 27 Dec 2006 18:20:37 +0000 Subject: Fixing #365. I am not sure what the problem was in previous versions, because the new graphing stuff changed the solution to this problem, but it all works now. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1972 980ebf18-57e1-0310-9a29-db15c13687c0 --- lib/puppet/server/filebucket.rb | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'lib/puppet/server') diff --git a/lib/puppet/server/filebucket.rb b/lib/puppet/server/filebucket.rb index 3fd4a8f5f..fa86e970b 100755 --- a/lib/puppet/server/filebucket.rb +++ b/lib/puppet/server/filebucket.rb @@ -64,8 +64,10 @@ class Server end # accept a file from a client - def addfile(string,path, client = nil, clientip = nil) - contents = Base64.decode64(string) + def addfile(contents, path, client = nil, clientip = nil) + if client + contents = Base64.decode64(contents) + end md5 = Digest::MD5.hexdigest(contents) bpath, bfile, pathpath = FileBucket.paths(@path,md5) @@ -141,8 +143,12 @@ class Server File.open(bfile) { |of| contents = of.read } - - return Base64.encode64(contents) + + if client + return Base64.encode64(contents) + else + return contents + end end def to_s -- cgit