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

http-call

Package Overview
Dependencies
Maintainers
4
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

http-call - npm Package Compare versions

Comparing version 4.0.0-ts1 to 4.0.0-ts2

lib/deps.d.ts

4

lib/http.d.ts
/// <reference types="node" />
import 'core-js/library';
import * as http from 'http';
import http = require('http');
export declare type Protocol = 'https:' | 'http:';

@@ -124,3 +124,3 @@ /**

_getNextRange(): Promise<void>;
_redactedHeaders(headers: http.IncomingHttpHeaders | http.OutgoingHttpHeaders): http.IncomingHttpHeaders | http.OutgoingHttpHeaders;
_redactedHeaders(headers: http.IncomingHttpHeaders | http.OutgoingHttpHeaders): http.OutgoingHttpHeaders | http.IncomingHttpHeaders;
readonly _responseOK: boolean;

@@ -127,0 +127,0 @@ readonly _responseRedirect: boolean;

@@ -14,6 +14,3 @@ "use strict";

const uri = require("url");
const http = require("http");
const https = require("https");
const proxy_1 = require("./proxy");
const isStream = require("is-stream");
const deps_1 = require("./deps");
const pjson = require('../package.json');

@@ -30,2 +27,5 @@ const debug = require('debug')('http');

}
function stringOrFirstString(o) {
return Array.isArray(o) ? o[0] : o;
}
function caseInsensitiveObject() {

@@ -202,3 +202,3 @@ let lowercaseKey = (k) => (typeof k === 'string') ? k.toLowerCase() : k;

this.options.path = u.path || '/';
this.options.agent = this.options.agent || proxy_1.default.agent(this.secure);
this.options.agent = this.options.agent || deps_1.deps.proxy.agent(this.secure);
this.options.port = u.port || this.constructor.defaultOptions.port || (this.secure ? 443 : 80);

@@ -305,9 +305,9 @@ }

if (this.secure) {
this.request = https.request(this.options, resolve);
this.request = deps_1.deps.https.request(this.options, resolve);
}
else {
this.request = http.request(this.options, resolve);
this.request = deps_1.deps.http.request(this.options, resolve);
}
this.request.on('error', reject);
if (this.options.body && isStream.readable(this.options.body)) {
if (this.options.body && deps_1.deps.isStream.readable(this.options.body)) {
this.options.body.pipe(this.request);

@@ -323,3 +323,3 @@ }

this.body = yield concat(this.response);
let json = this.headers['content-type'] === 'application/json';
let json = deps_1.deps.mime.contentType(stringOrFirstString(this.headers['content-type'])) === deps_1.deps.mime.contentType('application/json');
if (json)

@@ -330,3 +330,3 @@ this.body = JSON.parse(this.body);

_parseBody(body) {
if (isStream.readable(body)) {
if (deps_1.deps.isStream.readable(body)) {
this.options.body = body;

@@ -333,0 +333,0 @@ return;

{
"name": "http-call",
"description": "make http requests",
"version": "4.0.0-ts1",
"version": "4.0.0-ts2",
"author": "Jeff Dickey @jdxcode",
"bugs": "https://github.com/jdxcode/http-call/issues",
"dependencies": {
"core-js": "^2.5.1",
"debug": "^3.0.1",
"is-retry-allowed": "^1.1.0",
"is-stream": "^1.1.0",
"mime-types": "^2.1.17",
"tunnel-agent": "^0.6.0"

@@ -16,2 +18,3 @@ },

"@types/jest": "^20.0.8",
"@types/mime-types": "^2.1.0",
"@types/nock": "^8.2.1",

@@ -18,0 +21,0 @@ "@types/node": "^8.0.28",

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