diff --git a/dist/index.js b/dist/index.js index a07e049..eec8159 100644 --- a/dist/index.js +++ b/dist/index.js @@ -4579,7 +4579,7 @@ class HttpClientResponse { } readBody() { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let buffer = Buffer.alloc(0); + const chunks = []; const encodingCharset = util.obtainContentCharset(this); // Extract Encoding from header: 'content-encoding' // Match `gzip`, `gzip, deflate` variations of GZIP encoding @@ -4587,9 +4587,10 @@ class HttpClientResponse { const isGzippedEncoded = new RegExp('(gzip$)|(gzip, *deflate)').test(contentEncoding); this.message.on('data', function (data) { const chunk = (typeof data === 'string') ? Buffer.from(data, encodingCharset) : data; - buffer = Buffer.concat([buffer, chunk]); + chunks.push(chunk); }).on('end', function () { return __awaiter(this, void 0, void 0, function* () { + const buffer = Buffer.concat(chunks); if (isGzippedEncoded) { // Process GZipped Response Body HERE const gunzippedBody = yield util.decompressGzippedContent(buffer, encodingCharset); resolve(gunzippedBody); @@ -5120,7 +5121,9 @@ function decompressGzippedContent(buffer, charset) { if (error) { reject(error); } - resolve(buffer.toString(charset || 'utf-8')); + else { + resolve(buffer.toString(charset || 'utf-8')); + } }); })); }); diff --git a/package-lock.json b/package-lock.json index c19449d..0952419 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "MIT", "dependencies": { "@actions/core": "1.10.0", - "typed-rest-client": "1.8.4", + "typed-rest-client": "1.8.9", "unhomoglyph": "1.0.6" }, "devDependencies": { @@ -7287,9 +7287,9 @@ } }, "node_modules/typed-rest-client": { - "version": "1.8.4", - "resolved": "https://registry.npmjs.org/typed-rest-client/-/typed-rest-client-1.8.4.tgz", - "integrity": "sha512-MyfKKYzk3I6/QQp6e1T50py4qg+c+9BzOEl2rBmQIpStwNUoqQ73An+Tkfy9YuV7O+o2mpVVJpe+fH//POZkbg==", + "version": "1.8.9", + "resolved": "https://registry.npmjs.org/typed-rest-client/-/typed-rest-client-1.8.9.tgz", + "integrity": "sha512-uSmjE38B80wjL85UFX3sTYEUlvZ1JgCRhsWj/fJ4rZ0FqDUFoIuodtiVeE+cUqiVTOKPdKrp/sdftD15MDek6g==", "dependencies": { "qs": "^6.9.1", "tunnel": "0.0.6", @@ -13180,9 +13180,9 @@ } }, "typed-rest-client": { - "version": "1.8.4", - "resolved": "https://registry.npmjs.org/typed-rest-client/-/typed-rest-client-1.8.4.tgz", - "integrity": "sha512-MyfKKYzk3I6/QQp6e1T50py4qg+c+9BzOEl2rBmQIpStwNUoqQ73An+Tkfy9YuV7O+o2mpVVJpe+fH//POZkbg==", + "version": "1.8.9", + "resolved": "https://registry.npmjs.org/typed-rest-client/-/typed-rest-client-1.8.9.tgz", + "integrity": "sha512-uSmjE38B80wjL85UFX3sTYEUlvZ1JgCRhsWj/fJ4rZ0FqDUFoIuodtiVeE+cUqiVTOKPdKrp/sdftD15MDek6g==", "requires": { "qs": "^6.9.1", "tunnel": "0.0.6", diff --git a/package.json b/package.json index daa0eec..a22a85d 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "license": "MIT", "dependencies": { "@actions/core": "1.10.0", - "typed-rest-client": "1.8.4", + "typed-rest-client": "1.8.9", "unhomoglyph": "1.0.6" }, "devDependencies": {