diff options
Diffstat (limited to 'lib/puppet/server')
| -rwxr-xr-x | lib/puppet/server/filebucket.rb | 14 |
1 files changed, 10 insertions, 4 deletions
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 |
