Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

typed-rest-client

Package Overview
Dependencies
Maintainers
4
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typed-rest-client - npm Package Compare versions

Comparing version 1.7.2 to 1.7.3

2

package.json
{
"name": "typed-rest-client",
"version": "1.7.2",
"version": "1.7.3",
"description": "Node Rest and Http Clients for use with TypeScript",

@@ -5,0 +5,0 @@ "main": "./RestClient.js",

@@ -77,3 +77,3 @@ /// <reference types="node" />

private static dateTimeDeserializer;
private _processResponse;
protected processResponse<T>(res: httpm.HttpClientResponse, options: IRequestOptions): Promise<IRestResponse<T>>;
}

@@ -40,3 +40,3 @@ "use strict";

let res = yield this.client.options(url, this._headersFromOptions(options));
return this._processResponse(res, options);
return this.processResponse(res, options);
});

@@ -54,3 +54,3 @@ }

let res = yield this.client.get(url, this._headersFromOptions(options));
return this._processResponse(res, options);
return this.processResponse(res, options);
});

@@ -68,3 +68,3 @@ }

let res = yield this.client.del(url, this._headersFromOptions(options));
return this._processResponse(res, options);
return this.processResponse(res, options);
});

@@ -85,3 +85,3 @@ }

let res = yield this.client.post(url, data, headers);
return this._processResponse(res, options);
return this.processResponse(res, options);
});

@@ -102,3 +102,3 @@ }

let res = yield this.client.patch(url, data, headers);
return this._processResponse(res, options);
return this.processResponse(res, options);
});

@@ -119,3 +119,3 @@ }

let res = yield this.client.put(url, data, headers);
return this._processResponse(res, options);
return this.processResponse(res, options);
});

@@ -128,3 +128,3 @@ }

let res = yield this.client.sendStream(verb, url, stream, headers);
return this._processResponse(res, options);
return this.processResponse(res, options);
});

@@ -158,3 +158,3 @@ }

}
_processResponse(res, options) {
processResponse(res, options) {
return __awaiter(this, void 0, void 0, function* () {

@@ -161,0 +161,0 @@ return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {

@@ -114,6 +114,7 @@ "use strict";

// However, if the matches Array was empty or no charset found, 'utf-8' would be returned by default.
const nodeSupportedEncodings = ['ascii', 'utf8', 'utf16le', 'ucs2', 'base64', 'binary', 'hex'];
const contentType = response.message.headers['content-type'] || '';
const matches = contentType.match(/charset=([^;,\r\n]+)/i);
return (matches && matches[1]) ? matches[1] : 'utf-8';
return (matches && matches[1] && nodeSupportedEncodings.indexOf(matches[1]) != -1) ? matches[1] : 'utf-8';
}
exports.obtainContentCharset = obtainContentCharset;
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc