You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

azure-iot-http-base

Package Overview
Dependencies
Maintainers
5
Versions
107
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

azure-iot-http-base - npm Package Compare versions

Comparing version

to
1.9.0-preview.0

23

lib/rest_api_client.js

@@ -123,5 +123,22 @@ // Copyright (c) Microsoft. All rights reserved.

else {
/*Codes_SRS_NODE_IOTHUB_REST_API_CLIENT_16_009: [If the HTTP request is successful the `executeApiCall` method shall parse the JSON response received and call the `done` callback with a `null` first argument, the parsed result as a second argument and the HTTP response object itself as a third argument.]*/
var result = responseBody ? JSON.parse(responseBody) : '';
done(null, result, response);
/*Codes_SRS_NODE_IOTHUB_REST_API_CLIENT_16_009: [If the HTTP request is successful and the content-type header contains `application/json` the `executeApiCall` method shall parse the JSON response received and call the `done` callback with a `null` first argument, the parsed result as a second argument and the HTTP response object itself as a third argument.]*/
var result = '';
var parseError = null;
/*Codes_SRS_NODE_IOTHUB_REST_API_CLIENT_16_037: [If parsing the body of the HTTP response as JSON fails, the `done` callback shall be called with the SyntaxError thrown as a first argument, an `undefined` second argument, and the HTTP response object itself as a third argument.]*/
var expectJson = response.headers && response.headers['content-type'] && response.headers['content-type'].indexOf('application/json') >= 0;
if (responseBody && expectJson) {
try {
result = JSON.parse(responseBody);
}
catch (ex) {
if (ex instanceof SyntaxError) {
parseError = ex;
result = undefined;
}
else {
throw ex;
}
}
}
done(parseError, result, response);
}

@@ -128,0 +145,0 @@ };

4

package.json
{
"name": "azure-iot-http-base",
"version": "1.8.2",
"version": "1.9.0-preview.0",
"description": "HTTP operations used by Azure IoT device and service SDKs",

@@ -10,3 +10,3 @@ "author": "Microsoft Corporation",

"dependencies": {
"azure-iot-common": "1.8.2",
"azure-iot-common": "1.9.0-preview.0",
"debug": "^3.1.0",

@@ -13,0 +13,0 @@ "uuid": "^3.2.1"