Socket
Socket
Sign inDemoInstall

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 3.0.0 to 3.0.1

42

lib/http.js

@@ -185,4 +185,4 @@ 'use strict';

* const http = require('http-call')
* let rsp = await http.get('https://google.com')
* rsp.on('data', console.log)
* let {response} = await http.get('https://google.com')
* response.on('data', console.log)
* ```

@@ -202,3 +202,3 @@ */

return class CustomHTTP extends HTTP {
get defaultOptions() {
static get defaultOptions() {
return {

@@ -212,2 +212,16 @@ ...super.defaultOptions,

static get defaultOptions() {
return {
method: 'GET',
host: 'localhost',
protocol: 'https:',
path: '/',
raw: false,
partial: false,
headers: {
'user-agent': `${_package2.default.name}/${_package2.default.version} node-${process.version}`
}
};
}
// instance properties

@@ -231,6 +245,6 @@

this.options.protocol = u.protocol || this.options.protocol;
this.options.host = u.hostname || this.defaultOptions.host || 'localhost';
this.options.host = u.hostname || this.constructor.defaultOptions.host || 'localhost';
this.options.path = u.path || '/';
this.options.agent = this.options.agent || _proxy2.default.agent(this.secure);
this.options.port = parseInt(u.port || this.defaultOptions.port || (this.secure ? 443 : 80));
this.options.port = parseInt(u.port || this.constructor.defaultOptions.port || (this.secure ? 443 : 80));
}

@@ -245,22 +259,8 @@ get headers() {

}
get defaultOptions() {
return {
method: 'GET',
host: 'localhost',
protocol: 'https:',
path: '/',
raw: false,
partial: false,
headers: {
'user-agent': `${_package2.default.name}/${_package2.default.version} node-${process.version}`
}
};
}
constructor(url, options = {}) {
this.options = {
...this.defaultOptions,
...this.constructor.defaultOptions,
...options,
headers: lowercaseHeaders({
...this.defaultOptions.headers,
...this.constructor.defaultOptions.headers,
...options.headers

@@ -267,0 +267,0 @@ })

{
"name": "http-call",
"description": "make http requests",
"version": "3.0.0",
"version": "3.0.1",
"author": "Jeff Dickey @dickeyxxx",

@@ -22,3 +22,3 @@ "bugs": "https://github.com/dickeyxxx/http-call/issues",

"babel-plugin-transform-flow-strip-types": "6.22.0",
"flow-bin": "0.52.0",
"flow-bin": "^0.54.0",
"flow-copy-source": "^1.2.1",

@@ -25,0 +25,0 @@ "flow-typed": "^2.1.5",

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