linkinator
Advanced tools
Comparing version 2.9.0 to 2.10.0
@@ -183,2 +183,3 @@ #!/usr/bin/env node | ||
logger.error(` ${state} ${chalk.gray(link.url)}`); | ||
logger.debug(JSON.stringify(link.failureDetails, null, 2)); | ||
break; | ||
@@ -185,0 +186,0 @@ case index_1.LinkState.OK: |
@@ -26,2 +26,3 @@ /// <reference types="node" /> | ||
parent?: string; | ||
failureDetails?: {}[]; | ||
} | ||
@@ -28,0 +29,0 @@ export interface CrawlResult { |
@@ -5,3 +5,3 @@ "use strict"; | ||
const events_1 = require("events"); | ||
const gaxios = require("gaxios"); | ||
const gaxios_1 = require("gaxios"); | ||
const http = require("http"); | ||
@@ -259,4 +259,5 @@ const enableDestroy = require("server-destroy"); | ||
let res = undefined; | ||
const failures = []; | ||
try { | ||
res = await gaxios.request({ | ||
res = await gaxios_1.request({ | ||
method: opts.crawl ? 'GET' : 'HEAD', | ||
@@ -271,3 +272,3 @@ url: opts.url.href, | ||
if (res.status === 405) { | ||
res = await gaxios.request({ | ||
res = await gaxios_1.request({ | ||
method: 'GET', | ||
@@ -286,2 +287,3 @@ url: opts.url.href, | ||
// for this reason, we also try doing a GET below to see if the link is valid | ||
failures.push(err); | ||
} | ||
@@ -292,3 +294,3 @@ try { | ||
!opts.crawl) { | ||
res = await gaxios.request({ | ||
res = await gaxios_1.request({ | ||
method: 'GET', | ||
@@ -304,2 +306,3 @@ url: opts.url.href, | ||
catch (ex) { | ||
failures.push(ex); | ||
// catch the next failure | ||
@@ -316,2 +319,5 @@ } | ||
} | ||
else { | ||
failures.push(res); | ||
} | ||
const result = { | ||
@@ -322,2 +328,3 @@ url: opts.url.href, | ||
parent: opts.parent, | ||
failureDetails: failures, | ||
}; | ||
@@ -324,0 +331,0 @@ opts.results.push(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.9.0", | ||
"version": "2.10.0", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "repository": "JustinBeckwith/linkinator", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
70303
928