Skip to content
This repository was archived by the owner on Feb 21, 2025. It is now read-only.

Commit 9c75b4d

Browse files
committed
Update type-rest-client to 1.8.9
1 parent 48ced99 commit 9c75b4d

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

dist/index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4579,17 +4579,18 @@ class HttpClientResponse {
45794579
}
45804580
readBody() {
45814581
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
4582-
let buffer = Buffer.alloc(0);
4582+
const chunks = [];
45834583
const encodingCharset = util.obtainContentCharset(this);
45844584
// Extract Encoding from header: 'content-encoding'
45854585
// Match `gzip`, `gzip, deflate` variations of GZIP encoding
45864586
const contentEncoding = this.message.headers['content-encoding'] || '';
45874587
const isGzippedEncoded = new RegExp('(gzip$)|(gzip, *deflate)').test(contentEncoding);
45884588
this.message.on('data', function (data) {
45894589
const chunk = (typeof data === 'string') ? Buffer.from(data, encodingCharset) : data;
4590-
buffer = Buffer.concat([buffer, chunk]);
4590+
chunks.push(chunk);
45914591
}).on('end', function () {
45924592
return __awaiter(this, void 0, void 0, function* () {
4593+
const buffer = Buffer.concat(chunks);
45934594
if (isGzippedEncoded) { // Process GZipped Response Body HERE
45944595
const gunzippedBody = yield util.decompressGzippedContent(buffer, encodingCharset);
45954596
resolve(gunzippedBody);
@@ -5120,7 +5121,9 @@ function decompressGzippedContent(buffer, charset) {
51205121
if (error) {
51215122
reject(error);
51225123
}
5123-
resolve(buffer.toString(charset || 'utf-8'));
5124+
else {
5125+
resolve(buffer.toString(charset || 'utf-8'));
5126+
}
51245127
});
51255128
}));
51265129
});

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"license": "MIT",
2727
"dependencies": {
2828
"@actions/core": "1.10.0",
29-
"typed-rest-client": "1.8.4",
29+
"typed-rest-client": "1.8.9",
3030
"unhomoglyph": "1.0.6"
3131
},
3232
"devDependencies": {

0 commit comments

Comments
 (0)