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 2.1.1 to 2.1.2

19

lib/http.js

@@ -32,2 +32,6 @@ 'use strict';

var _isStream = require('is-stream');
var _isStream2 = _interopRequireDefault(_isStream);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -231,6 +235,9 @@

return new Promise((resolve, reject) => {
let request = this.http.request(this, resolve);
request.on('error', reject);
if (this.requestBody) request.write(this.requestBody);
request.end();
this.request = this.http.request(this, resolve);
this.request.on('error', reject);
if (_isStream2.default.readable(this.requestBody)) {
this.requestBody.pipe(this.request);
} else {
this.request.end(this.requestBody);
}
});

@@ -245,2 +252,6 @@ }

parseBody(body) {
if (_isStream2.default.readable(body)) {
this.requestBody = body;
return;
}
if (!this.headers['Content-Type']) {

@@ -247,0 +258,0 @@ this.headers['Content-Type'] = 'application/json';

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

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

"is-retry-allowed": "^1.1.0",
"is-stream": "^1.1.0",
"tunnel-agent": "^0.6.0"

@@ -15,3 +16,3 @@ },

"babel-cli": "6.24.1",
"babel-core": "6.24.1",
"babel-core": "^6.25.0",
"babel-eslint": "7.2.3",

@@ -68,2 +69,3 @@ "babel-jest": "20.0.3",

"http$IncomingMessage",
"http$ClientRequest",
"$Diff",

@@ -70,0 +72,0 @@ "$Shape"

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