New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

supra-http

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

supra-http - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

14

dist/http.js

@@ -20,2 +20,9 @@ "use strict";

request(url, requestOptions) {
const requestProvider = url.startsWith('https') ? {
agent: this.httpsAgent,
client: https_1.default
} : {
agent: this.httpAgent,
client: http_1.default
};
const requestBody = typeof requestOptions.body === "object" ?

@@ -25,5 +32,5 @@ JSON.stringify(requestOptions.body) :

requestOptions.body : undefined;
const options = this.createRequestOptions(url, requestOptions, requestBody);
const options = this.createRequestOptions(url, requestOptions, requestProvider.agent, requestBody);
return new Promise(resolve => {
const request = http_1.default.request(url, options, response => {
const request = requestProvider.client.request(url, options, response => {
compression_1.Compression.handle(response)

@@ -41,4 +48,3 @@ .then(body => resolve({

}
createRequestOptions(url, options, bodyContent) {
const agent = url.startsWith('https') ? this.httpsAgent : this.httpAgent;
createRequestOptions(url, options, agent, bodyContent) {
const mergedOptions = {

@@ -45,0 +51,0 @@ method: options.method || 'get',

{
"name": "supra-http",
"version": "1.0.2",
"version": "1.0.3",
"description": "Circuit breaking http client for NodeJs. And it is fast...",

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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