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

follow-redirects

Package Overview
Dependencies
Maintainers
2
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

follow-redirects - npm Package Compare versions

Comparing version 1.15.2 to 1.15.3

20

index.js

@@ -41,2 +41,5 @@ var url = require("url");

// istanbul ignore next
var destroy = Writable.prototype.destroy || noop;
// An HTTP(S) request that can be redirected

@@ -72,6 +75,13 @@ function RedirectableRequest(options, responseCallback) {

RedirectableRequest.prototype.abort = function () {
abortRequest(this._currentRequest);
destroyRequest(this._currentRequest);
this._currentRequest.abort();
this.emit("abort");
};
RedirectableRequest.prototype.destroy = function (error) {
destroyRequest(this._currentRequest, error);
destroy.call(this, error);
return this;
};
// Writes buffered data to the current native request

@@ -189,2 +199,3 @@ RedirectableRequest.prototype.write = function (data, encoding, callback) {

self.removeListener("response", clearTimer);
self.removeListener("close", clearTimer);
if (callback) {

@@ -216,2 +227,3 @@ self.removeListener("timeout", callback);

this.on("response", clearTimer);
this.on("close", clearTimer);

@@ -368,3 +380,3 @@ return this;

// The response is a redirect, so abort the current request
abortRequest(this._currentRequest);
destroyRequest(this._currentRequest);
// Discard the remainder of the response to avoid waiting for data

@@ -598,3 +610,3 @@ response.destroy();

function abortRequest(request) {
function destroyRequest(request, error) {
for (var event of events) {

@@ -604,3 +616,3 @@ request.removeListener(event, eventHandlers[event]);

request.on("error", noop);
request.abort();
request.destroy(error);
}

@@ -607,0 +619,0 @@

{
"name": "follow-redirects",
"version": "1.15.2",
"version": "1.15.3",
"description": "HTTP and HTTPS modules that follow redirects.",

@@ -14,5 +14,4 @@ "license": "MIT",

"scripts": {
"test": "npm run lint && npm run mocha",
"lint": "eslint *.js test",
"mocha": "nyc mocha"
"test": "nyc mocha"
},

@@ -19,0 +18,0 @@ "repository": {

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