Skip to content
This repository has been archived by the owner on Jun 5, 2018. It is now read-only.

Commit

Permalink
restored the extrasContentLength function but made it use Buffer.byte…
Browse files Browse the repository at this point in the history
…Length() rather than [string].length and made PutBucket call it explicitly rather than it's previous implicit call via extrasContentMd5
  • Loading branch information
nfriedly committed Apr 6, 2012
1 parent e820336 commit 0142c84
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/amazon/s3-config.js
Expand Up @@ -295,6 +295,13 @@ function bodyCompleteMultipartUpload(options, args) {
return data2xml('CompleteMultipartUpload', data);
}

function extrasContentLength(options, args) {
var self = this;

// add the Content-Length header we need
options.headers['Content-Length'] = args.ContentLength || Buffer.byteLength( options.body );
}

function extrasContentMd5(options, args) {
var self = this;

Expand Down Expand Up @@ -768,7 +775,7 @@ module.exports = {
},
},
body : bodyLifecycleConfiguration,
addExtras : extrasContentMd5,
addExtras : [ extrasContentMd5, extrasContentLength ],
// response
extractBody : 'none',
},
Expand Down

0 comments on commit 0142c84

Please sign in to comment.