Skip to content

Commit

Permalink
handle 'continue' event only once (#3674)
Browse files Browse the repository at this point in the history
Linode Object Storage sends multiple '100 continue' lines as a response
to 'Expect: 100-continue'. This causes node.js to parse the response
correctly and fire the 'continue' event twice.

See also #3404
  • Loading branch information
gramakri authored Apr 2, 2021
1 parent 3691e82 commit fc12b66
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-a986db56.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "bugfix",
"category": "s3",
"description": "handle 'continue' event only once"
}
2 changes: 1 addition & 1 deletion lib/http/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ AWS.NodeHttpClient = AWS.util.inherit({

var expect = httpRequest.headers.Expect || httpRequest.headers.expect;
if (expect === '100-continue') {
stream.on('continue', function() {
stream.once('continue', function() {
self.writeBody(stream, httpRequest);
});
} else {
Expand Down

0 comments on commit fc12b66

Please sign in to comment.