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

ovh

Package Overview
Dependencies
Maintainers
2
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ovh - npm Package Compare versions

Comparing version 1.1.2 to 1.1.3

4

CHANGELOG.md
# Changelog
## 1.1.3
* Support zero-byte JSON HTTP bodies (#2)
## 1.1.2

@@ -4,0 +8,0 @@

32

lib/ovh.js

@@ -575,24 +575,24 @@ /**

try {
response = JSON.parse(body);
if (this.debug) {
this.debug(
'[OVH]',
'API response to',
options.method, options.path, ':',
body
);
if (body.length > 0) {
try {
response = JSON.parse(body);
}
} catch (e) {
if (res.statusCode !== 200) {
return callback('[OVH] Error in response, HTTP code is ' + res.statusCode, res.statusCode);
}
else {
catch (e) {
return callback('[OVH] Unable to parse JSON reponse');
}
}
else {
response = null;
}
if (this.debug) {
this.debug(
'[OVH] API response to',
options.method, options.path, ':',
body
);
}
if (res.statusCode !== 200) {
callback(res.statusCode, response.message);
callback(res.statusCode, response ? response.message : response);
}

@@ -599,0 +599,0 @@ else {

{
"name": "ovh",
"version": "1.1.2",
"version": "1.1.3",
"description": "Official Node.js wrapper for the OVH APIs",

@@ -5,0 +5,0 @@ "homepage": "http://ovh.github.io/node-ovh",

@@ -75,7 +75,8 @@ /**

.intercept('/1.0/me', 'GET')
.reply(401);
.reply(401, {'message': 'You must login first'});
var rest = ovh({ appKey: 'XXX', appSecret: 'XXX', apis: [] });
rest.request('GET', '/me', function (err, message) {
assert.equal(message, 401);
assert.equal(err, 401);
assert.equal(message, 'You must login first');
done();

@@ -82,0 +83,0 @@ });

@@ -257,4 +257,25 @@ /**

});
},
'DELETE /todelete - 0 bytes JSON body': function (done) {
'use strict';
nock('https://eu.api.ovh.com')
.intercept('/1.0/auth/time', 'GET')
.reply(200, Math.round(Date.now() / 1000))
.intercept('/1.0/todelete', 'DELETE')
.reply(200, '');
var rest = ovh({
appKey: APP_KEY,
appSecret: APP_SECRET,
consumerKey: CONSUMER_KEY
});
rest.request('DELETE', '/todelete', function (err, message) {
assert.ok(!err);
assert.equal(message, null);
done();
});
}
};
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