Socket
Socket
Sign inDemoInstall

follow-redirects

Package Overview
Dependencies
0
Maintainers
2
Versions
65
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.14.3 to 1.14.4

21

index.js

@@ -150,6 +150,4 @@ var url = require("url");

var self = this;
if (callback) {
this.on("timeout", callback);
}
// Destroys the socket on timeout
function destroyOnTimeout(socket) {

@@ -173,9 +171,12 @@ socket.setTimeout(msecs);

// Prevent a timeout from triggering
// Stops a timeout from triggering
function clearTimer() {
clearTimeout(self._timeout);
if (self._timeout) {
clearTimeout(self._timeout);
self._timeout = null;
}
if (callback) {
self.removeListener("timeout", callback);
}
if (!this.socket) {
if (!self.socket) {
self._currentRequest.removeListener("socket", startTimer);

@@ -185,3 +186,8 @@ }

// Start the timer when the socket is opened
// Attach callback if passed
if (callback) {
this.on("timeout", callback);
}
// Start the timer if or when the socket is opened
if (this.socket) {

@@ -194,2 +200,3 @@ startTimer(this.socket);

// Clean up on events
this.on("socket", destroyOnTimeout);

@@ -196,0 +203,0 @@ this.once("response", clearTimer);

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

@@ -5,0 +5,0 @@ "license": "MIT",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc