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

linkinator

Package Overview
Dependencies
Maintainers
1
Versions
114
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

linkinator - npm Package Compare versions

Comparing version 2.0.4 to 2.0.5

34

build/src/index.js

@@ -134,4 +134,5 @@ "use strict";

let shouldRecurse = false;
let res = undefined;
try {
let res = await gaxios.request({
res = await gaxios.request({
method: opts.crawl ? 'GET' : 'HEAD',

@@ -151,12 +152,31 @@ url: opts.url.href,

}
// Assume any 2xx status is 👌
}
catch (err) {
// request failure: invalid domain name, etc.
// this also occasionally catches too many redirects, but is still valid (e.g. https://www.ebay.com)
// for this reason, we also try doing a GET below to see if the link is valid
}
try {
//some sites don't respond to a stream response type correctly, especially with a HEAD. Try a GET with a text response type
if ((res === undefined || res.status < 200 || res.status >= 300) &&
!opts.crawl) {
res = await gaxios.request({
method: 'GET',
url: opts.url.href,
responseType: 'text',
validateStatus: () => true,
});
}
}
catch (ex) {
//catch the next failure
}
if (res !== undefined) {
status = res.status;
if (res.status >= 200 && res.status < 300) {
state = LinkState.OK;
}
data = res.data;
shouldRecurse = isHtml(res);
}
catch (err) {
// request failure: invalid domain name, etc.
// Assume any 2xx status is 👌
if (status >= 200 && status < 300) {
state = LinkState.OK;
}

@@ -163,0 +183,0 @@ const result = {

{
"name": "linkinator",
"description": "Find broken links, missing images, etc in your HTML. Scurry around your site and find all those broken links.",
"version": "2.0.4",
"version": "2.0.5",
"license": "MIT",

@@ -42,3 +42,3 @@ "repository": "JustinBeckwith/linkinator",

"@types/server-destroy": "^1.0.0",
"@types/sinon": "^7.5.0",
"@types/sinon": "^9.0.0",
"@types/update-notifier": "^4.0.0",

@@ -45,0 +45,0 @@ "assert-rejects": "^1.0.0",

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