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

npm-registry-client

Package Overview
Dependencies
Maintainers
2
Versions
156
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

npm-registry-client - npm Package Compare versions

Comparing version 3.2.0 to 3.2.1

test/fetch-404.js

38

lib/fetch.js

@@ -22,5 +22,5 @@ var assert = require("assert")

req.on("error", function (err) {
if (operation.retry(err)) {
client.log.info("retry", "will retry, error on last attempt: " + err)
req.on("error", function (er) {
if (operation.retry(er)) {
client.log.info("retry", "will retry, error on last attempt: " + er)
}

@@ -32,22 +32,26 @@ })

// Only retry on 408, 5xx or no `response`.
var er
var statusCode = res && res.statusCode
if (statusCode === 200) {
// Work around bug in node v0.10.0 where the CryptoStream
// gets stuck and never starts reading again.
res.resume()
if (process.version === "v0.10.0") unstick(res)
var timeout = statusCode === 408
if (timeout) er = new Error("request timed out")
return cb(null, res)
}
// Only retry on 408, 5xx or no `response`.
else if (statusCode === 408) {
er = new Error("request timed out")
}
else if (statusCode >= 500) {
er = new Error("server error " + statusCode)
}
var serverError = statusCode >= 500
if (serverError) er = new Error("server error " + statusCode)
if (er && operation.retry(er)) {
client.log.info("retry", "will retry, error on last attempt: " + er)
return
}
// Work around bug in node v0.10.0 where the CryptoStream
// gets stuck and never starts reading again.
res.resume()
if (process.version === "v0.10.0") unstick(res)
cb(null, res)
else {
cb(new Error("fetch failed with status code " + statusCode))
}
})

@@ -54,0 +58,0 @@ })

@@ -5,3 +5,3 @@ {

"description": "Client for the npm registry",
"version": "3.2.0",
"version": "3.2.1",
"repository": {

@@ -8,0 +8,0 @@ "url": "git://github.com/isaacs/npm-registry-client"

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