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

retry-request

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

retry-request - npm Package Compare versions

Comparing version 2.0.3 to 2.0.4

15

index.js
'use strict';
var firstEvent = require('first-event');
var request = require('request');

@@ -77,3 +78,3 @@ var through = require('through2');

if (requestStream.destroy) {
requestStream.destroy();
requestStream.destroy();
} else if (requestStream.end) {

@@ -92,7 +93,11 @@ requestStream.end();

firstEvent(requestStream, ['error', 'response'])
.then(resp => onResponse.apply(null, [null].concat(resp.args)))
.catch(onResponse);
requestStream
.on('error', onResponse)
.on('response', onResponse.bind(null, null))
.on('complete', retryStream.emit.bind(retryStream, 'complete'))
.pipe(delayStream);
.on('error', function() {}) // Cannot remove. Node internals get confused: https://github.com/stephenplusplus/retry-request/pull/11#discussion_r118394078
.on('complete', retryStream.emit.bind(retryStream, 'complete'));
requestStream.pipe(delayStream);
} else {

@@ -99,0 +104,0 @@ activeRequest = opts.request(requestOpts, onResponse);

{
"name": "retry-request",
"version": "2.0.3",
"version": "2.0.4",
"description": "Retry a request.",

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

"dependencies": {
"first-event": "^1.0.0",
"request": "^2.81.0",

@@ -27,0 +28,0 @@ "through2": "^2.0.0"

@@ -0,0 +0,0 @@ |![retry-request](logo.png)

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