diff --git a/lib/Util.ts b/lib/Util.ts index 0bd59929..3ceafdf7 100644 --- a/lib/Util.ts +++ b/lib/Util.ts @@ -91,9 +91,9 @@ export async function decompressGzippedContent(buffer: Buffer, charset?: string) zlib.gunzip(buffer, function (error, buffer) { if (error) { reject(error); + } else { + resolve(buffer.toString(charset || 'utf-8')); } - - resolve(buffer.toString(charset || 'utf-8')); }); }) } diff --git a/package-lock.json b/package-lock.json index 6bb51bea..c99ea242 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "typed-rest-client", - "version": "1.8.8", + "version": "1.8.9", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 44932b35..602193e8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "typed-rest-client", - "version": "1.8.8", + "version": "1.8.9", "description": "Node Rest and Http Clients for use with TypeScript", "main": "./RestClient.js", "scripts": {