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

bhttp

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bhttp - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

test-https-stream.coffee

32

lib/bhttp.js

@@ -1,2 +0,2 @@

var Promise, S, addErrorData, bhttpAPI, bhttpErrors, concatStream, createCookieJar, debug, debugRequest, debugResponse, doPayloadRequest, doRedirect, errors, extend, formData, formFixArray, http, https, isStream, makeRequest, ofTypes, packageConfig, prepareCleanup, prepareDefaults, prepareOptions, preparePayload, prepareProtocol, prepareRequest, prepareSession, prepareUrl, processResponse, querystring, redirectGet, redirectUnchanged, sink, spy, stream, streamLength, toughCookie, urlUtil, util, _;
var Promise, S, addErrorData, bhttpAPI, bhttpErrors, concatStream, createCookieJar, debug, debugRequest, debugResponse, devNull, doPayloadRequest, doRedirect, errors, extend, formData, formFixArray, http, https, isStream, makeRequest, ofTypes, packageConfig, prepareCleanup, prepareDefaults, prepareOptions, preparePayload, prepareProtocol, prepareRequest, prepareSession, prepareUrl, processResponse, querystring, redirectGet, redirectUnchanged, sink, spy, stream, streamLength, toughCookie, urlUtil, util, _;

@@ -33,2 +33,4 @@ urlUtil = require("url");

devNull = require("dev-null");
formData = require("form-data2");

@@ -491,3 +493,3 @@

} else if (request.responseOptions.discardResponse) {
response.resume();
response.pipe(devNull());
return Promise.resolve(response);

@@ -510,4 +512,24 @@ } else {

return new Promise(function(resolve, reject) {
response.pipe(progressStream);
response.pause();
var attachProgressStream, _on, _progressStreamAttached, _resume;
_resume = response.resume.bind(response);
_on = response.on.bind(response);
_progressStreamAttached = false;
attachProgressStream = function() {
if (!_progressStreamAttached) {
debugResponse("attaching progress stream");
_progressStreamAttached = true;
return response.pipe(progressStream);
}
};
response.on = function(eventName, handler) {
debugResponse("'on' called, " + eventName);
if (eventName === "data" || eventName === "readable") {
attachProgressStream();
}
return _on(eventName, handler);
};
response.resume = function() {
attachProgressStream();
return _resume();
};
if (request.responseOptions.stream) {

@@ -579,3 +601,3 @@ return resolve(response);

if (!request.responseOptions.keepRedirectResponses) {
response.resume();
response.pipe(devNull());
}

@@ -582,0 +604,0 @@ requestState.redirectHistory.push(response);

3

package.json
{
"name": "bhttp",
"version": "1.1.0",
"version": "1.1.1",
"description": "A sane HTTP client library for Node.js with Streams2 support.",

@@ -28,2 +28,3 @@ "main": "index.js",

"debug": "^2.1.1",
"dev-null": "^0.1.1",
"errors": "^0.2.0",

@@ -30,0 +31,0 @@ "extend": "^2.0.0",

Sorry, the diff of this file is not supported yet

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