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

cluster-request

Package Overview
Dependencies
Maintainers
2
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cluster-request - npm Package Compare versions

Comparing version 1.1.1 to 2.0.0

14

lib/index.js

@@ -75,8 +75,2 @@ const request = require('request');

this.lastResponse = {
statusCode: null,
body: null,
response: null,
};
return new Promise((resolve, reject) => {

@@ -110,4 +104,2 @@ request(

this.lastResponse = Object.assign({}, result);
this.validateResponse(result)

@@ -121,6 +113,2 @@ .then(() => resolve(result))

getLastResponse() {
return this.lastResponse;
}
/**

@@ -147,3 +135,3 @@ * Validate response

error.statusCode = safeResponse.statusCode;
error.body = response.body;
return Promise.reject(error);

@@ -150,0 +138,0 @@ }

7

lib/index.spec.js
const ClusterRequest = require('./index');
const clusterRequest = new ClusterRequest();
describe('Testing Requests', () => {

@@ -25,4 +24,4 @@

expect(err.message).toBe('ADVERTISER_NOT_FOUND (404)');
expect(clusterRequest.getLastResponse().statusCode).toBe(404);
expect(clusterRequest.getLastResponse().body.message).toBe('ADVERTISER_NOT_FOUND');
expect(err.statusCode).toBe(404);
expect(err.body.message).toBe('ADVERTISER_NOT_FOUND');
})

@@ -36,5 +35,5 @@ );

expect(err.message).toBe('Can\'t parse json');
expect(clusterRequest.getLastResponse()).toBe(null);
expect(err.statusCode).toBe(undefined);
})
);
});
{
"name": "cluster-request",
"version": "1.1.1",
"version": "2.0.0",
"description": "A proxy to send requests within a kubernetes cluster",

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

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