diff --git a/packages/http-client/package-lock.json b/packages/http-client/package-lock.json index 333acf7f..503a680a 100644 --- a/packages/http-client/package-lock.json +++ b/packages/http-client/package-lock.json @@ -1,12 +1,12 @@ { "name": "@actions/http-client", - "version": "2.1.0", + "version": "2.1.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@actions/http-client", - "version": "2.1.0", + "version": "2.1.1", "license": "MIT", "dependencies": { "tunnel": "^0.0.6" diff --git a/packages/http-client/package.json b/packages/http-client/package.json index 61af4ee1..f0c747bd 100644 --- a/packages/http-client/package.json +++ b/packages/http-client/package.json @@ -1,6 +1,6 @@ { "name": "@actions/http-client", - "version": "2.1.0", + "version": "2.1.1", "description": "Actions Http Client", "keywords": [ "github", diff --git a/packages/http-client/src/index.ts b/packages/http-client/src/index.ts index ebea203d..a63e61b7 100644 --- a/packages/http-client/src/index.ts +++ b/packages/http-client/src/index.ts @@ -102,6 +102,20 @@ export class HttpClientResponse { }) }) } + + async readBodyBuffer?(): Promise { + return new Promise(async resolve => { + const chunks: Buffer[] = [] + + this.message.on('data', (chunk: Buffer) => { + chunks.push(chunk) + }) + + this.message.on('end', () => { + resolve(Buffer.concat(chunks)) + }) + }) + } } export function isHttps(requestUrl: string): boolean {