typed-rest-client
Advanced tools
Comparing version 1.7.2 to 1.7.3
{ | ||
"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; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
154122
1656