Skip to content

Commit

Permalink
Merge pull request #2445 from srchase/fix-small-putObject-streams
Browse files Browse the repository at this point in the history
fix putObject with Stream <1mb, set 100-continue when Body is a Stream
  • Loading branch information
srchase authored Dec 20, 2018
2 parents 1987862 + 7d8593a commit 21b0a11
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changes/next-release/bugfix-S3-3de7228f.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "bugfix",
"category": "S3",
"description": "fix putObject using stream <1mb"
}
2 changes: 1 addition & 1 deletion lib/services/s3.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ AWS.util.update(AWS.S3.prototype, {
*/
addExpect100Continue: function addExpect100Continue(req) {
var len = req.httpRequest.headers['Content-Length'];
if (AWS.util.isNode() && len >= 1024 * 1024) {
if (AWS.util.isNode() && (len >= 1024 * 1024 || req.params.Body instanceof AWS.util.stream.Stream)) {
req.httpRequest.headers['Expect'] = '100-continue';
}
},
Expand Down

0 comments on commit 21b0a11

Please sign in to comment.