From fc12b6667a692389ac022c6c81c36591eaf47c92 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Fri, 2 Apr 2021 09:42:40 -0700 Subject: [PATCH] handle 'continue' event only once (#3674) 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 --- .changes/next-release/bugfix-s3-a986db56.json | 5 +++++ lib/http/node.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changes/next-release/bugfix-s3-a986db56.json diff --git a/.changes/next-release/bugfix-s3-a986db56.json b/.changes/next-release/bugfix-s3-a986db56.json new file mode 100644 index 0000000000..220934c94d --- /dev/null +++ b/.changes/next-release/bugfix-s3-a986db56.json @@ -0,0 +1,5 @@ +{ + "type": "bugfix", + "category": "s3", + "description": "handle 'continue' event only once" +} \ No newline at end of file diff --git a/lib/http/node.js b/lib/http/node.js index be69f691d7..a4c4a34fd7 100644 --- a/lib/http/node.js +++ b/lib/http/node.js @@ -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 {