linkinator
Advanced tools
Comparing version 6.0.7 to 6.1.0
@@ -70,2 +70,5 @@ #!/usr/bin/env node | ||
--user-agent | ||
The user agent passed in all HTTP requests. Defaults to 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36' | ||
--verbosity | ||
@@ -72,0 +75,0 @@ Override the default verbosity for this command. Available options are |
@@ -42,5 +42,2 @@ import { EventEmitter } from 'node:events'; | ||
}; | ||
export declare const headers: { | ||
'User-Agent': string; | ||
}; | ||
/** | ||
@@ -47,0 +44,0 @@ * Instance class used to perform a crawl job. |
@@ -15,6 +15,2 @@ import { EventEmitter } from 'node:events'; | ||
})(LinkState || (LinkState = {})); | ||
// Spoof a normal looking User-Agent to keep the servers happy | ||
export const headers = { | ||
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36', | ||
}; | ||
/** | ||
@@ -186,3 +182,3 @@ * Instance class used to perform a crawl job. | ||
url: options.url.href, | ||
headers, | ||
headers: { 'User-Agent': options.checkOptions.userAgent }, | ||
responseType: 'stream', | ||
@@ -200,3 +196,3 @@ validateStatus: () => true, | ||
url: options.url.href, | ||
headers, | ||
headers: { 'User-Agent': options.checkOptions.userAgent }, | ||
responseType: 'stream', | ||
@@ -229,3 +225,3 @@ validateStatus: () => true, | ||
validateStatus: () => true, | ||
headers, | ||
headers: { 'User-Agent': options.checkOptions.userAgent }, | ||
timeout: options.checkOptions.timeout, | ||
@@ -232,0 +228,0 @@ }); |
@@ -20,2 +20,3 @@ export type UrlRewriteExpression = { | ||
urlRewriteExpressions?: UrlRewriteExpression[]; | ||
userAgent?: string; | ||
}; | ||
@@ -26,2 +27,3 @@ export type InternalCheckOptions = { | ||
} & CheckOptions; | ||
export declare const DEFAULT_USER_AGENT = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36"; | ||
/** | ||
@@ -28,0 +30,0 @@ * Validate the provided flags all work with each other. |
@@ -5,2 +5,3 @@ import { promises as fs } from 'node:fs'; | ||
import { glob } from 'glob'; | ||
export const DEFAULT_USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36'; | ||
/** | ||
@@ -40,2 +41,3 @@ * Validate the provided flags all work with each other. | ||
} | ||
options.userAgent = options.userAgent ?? DEFAULT_USER_AGENT; | ||
options.serverRoot &&= path.normalize(options.serverRoot); | ||
@@ -42,0 +44,0 @@ // Expand globs into paths |
{ | ||
"name": "linkinator", | ||
"description": "Find broken links, missing images, etc in your HTML. Scurry around your site and find all those broken links.", | ||
"version": "6.0.7", | ||
"version": "6.1.0", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "repository": "JustinBeckwith/linkinator", |
@@ -96,2 +96,5 @@ # 🐿 linkinator | ||
--user-agent | ||
The user agent passed in all HTTP requests. Defaults to 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36' | ||
--verbosity | ||
@@ -177,2 +180,3 @@ Override the default verbosity for this command. Available options are | ||
"urlRewriteReplace": "replacement", | ||
"userAgent": "Mozilla/4.0 (compatible; MSIE 6.0; MSIE 5.5; Windows NT 5.1)", | ||
} | ||
@@ -228,2 +232,3 @@ ``` | ||
- `urlRewriteExpressions` (array) - Collection of objects that contain a search pattern, and replacement. | ||
- `userAgent` (string) - The [user agent](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent) that should be passed with each request. This uses a reasonable default. | ||
@@ -230,0 +235,0 @@ ### linkinator.LinkChecker() |
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
70799
373
1489