1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[AWS|Glacier] Use bytesize rather than length

This commit is contained in:
Frederick Cheung 2012-09-02 00:32:05 +01:00
parent 0ce5681841
commit 50504903d5
2 changed files with 3 additions and 3 deletions

View file

@ -22,7 +22,7 @@ module Fog
path = "/#{account_id}/vaults/#{Fog::AWS.escape(vault_name)}/archives"
headers = {
'Content-Length' => body.length.to_s,
'Content-Length' => body.bytesize.to_s,
'x-amz-content-sha256' => Digest::SHA256.hexdigest(body),
'x-amz-sha256-tree-hash' => Fog::AWS::Glacier::TreeHash.digest(body)
}

View file

@ -24,8 +24,8 @@ module Fog
path = "/#{account_id}/vaults/#{Fog::AWS.escape(vault_name)}/multipart-uploads/#{Fog::AWS.escape(upload_id)}"
headers = {
'Content-Length' => body.length.to_s,
'Content-Range' => "bytes #{offset}-#{offset+body.length-1}/*",
'Content-Length' => body.bytesize.to_s,
'Content-Range' => "bytes #{offset}-#{offset+body.bytesize-1}/*",
'x-amz-content-sha256' => Digest::SHA256.hexdigest(body),
'x-amz-sha256-tree-hash' => hash
}