Socket
Socket
Sign inDemoInstall

@algolia/requester-node-http

Package Overview
Dependencies
Maintainers
60
Versions
223
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@algolia/requester-node-http - npm Package Compare versions

Comparing version 4.5.1 to 4.6.0

16

dist/requester-node-http.cjs.js

@@ -10,6 +10,8 @@ 'use strict';

/* eslint functional/prefer-readonly-type: 0 */
function createNodeHttpRequester({ agent: userGlobalAgent, httpAgent: userHttpAgent, httpsAgent: userHttpsAgent, } = {}) {
const agentOptions = { keepAlive: true };
const httpAgent = userHttpAgent || userGlobalAgent || new http.Agent(agentOptions);
const httpsAgent = userHttpsAgent || userGlobalAgent || new https.Agent(agentOptions);
const agentOptions = { keepAlive: true };
const defaultHttpAgent = new http.Agent(agentOptions);
const defaultHttpsAgent = new https.Agent(agentOptions);
function createNodeHttpRequester({ agent: userGlobalAgent, httpAgent: userHttpAgent, httpsAgent: userHttpsAgent, requesterOptions = {}, } = {}) {
const httpAgent = userHttpAgent || userGlobalAgent || defaultHttpAgent;
const httpsAgent = userHttpsAgent || userGlobalAgent || defaultHttpsAgent;
return {

@@ -21,2 +23,3 @@ send(request) {

const options = {
...requesterOptions,
agent: url.protocol === 'https:' ? httpsAgent : httpAgent,

@@ -26,3 +29,6 @@ hostname: url.hostname,

method: request.method,
headers: request.headers,
headers: {
...(requesterOptions && requesterOptions.headers ? requesterOptions.headers : {}),
...request.headers,
},
...(url.port !== undefined ? { port: url.port || '' } : {}),

@@ -29,0 +35,0 @@ };

@@ -7,3 +7,3 @@ /// <reference types="node" />

export declare function createNodeHttpRequester({ agent: userGlobalAgent, httpAgent: userHttpAgent, httpsAgent: userHttpsAgent, }?: NodeHttpRequesterOptions): Requester & Destroyable;
export declare function createNodeHttpRequester({ agent: userGlobalAgent, httpAgent: userHttpAgent, httpsAgent: userHttpsAgent, requesterOptions, }?: NodeHttpRequesterOptions): Requester & Destroyable;

@@ -14,4 +14,5 @@ export declare type NodeHttpRequesterOptions = {

httpsAgent?: https.Agent;
requesterOptions?: https.RequestOptions;
};
export { }

@@ -8,6 +8,8 @@ import * as http from 'http';

/* eslint functional/prefer-readonly-type: 0 */
function createNodeHttpRequester({ agent: userGlobalAgent, httpAgent: userHttpAgent, httpsAgent: userHttpsAgent, } = {}) {
const agentOptions = { keepAlive: true };
const httpAgent = userHttpAgent || userGlobalAgent || new Agent(agentOptions);
const httpsAgent = userHttpsAgent || userGlobalAgent || new Agent$1(agentOptions);
const agentOptions = { keepAlive: true };
const defaultHttpAgent = new Agent(agentOptions);
const defaultHttpsAgent = new Agent$1(agentOptions);
function createNodeHttpRequester({ agent: userGlobalAgent, httpAgent: userHttpAgent, httpsAgent: userHttpsAgent, requesterOptions = {}, } = {}) {
const httpAgent = userHttpAgent || userGlobalAgent || defaultHttpAgent;
const httpsAgent = userHttpsAgent || userGlobalAgent || defaultHttpsAgent;
return {

@@ -19,2 +21,3 @@ send(request) {

const options = {
...requesterOptions,
agent: url.protocol === 'https:' ? httpsAgent : httpAgent,

@@ -24,3 +27,6 @@ hostname: url.hostname,

method: request.method,
headers: request.headers,
headers: {
...(requesterOptions && requesterOptions.headers ? requesterOptions.headers : {}),
...request.headers,
},
...(url.port !== undefined ? { port: url.port || '' } : {}),

@@ -27,0 +33,0 @@ };

{
"name": "@algolia/requester-node-http",
"version": "4.5.1",
"version": "4.6.0",
"private": false,

@@ -20,4 +20,4 @@ "description": "Promise-based request library for node using the native http module.",

"dependencies": {
"@algolia/requester-common": "4.5.1"
"@algolia/requester-common": "4.6.0"
}
}
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