@uxf/scripts 11.64.1 → 11.67.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -57,11 +57,9 @@ function getUrlOrigin(url) {
|
|
|
57
57
|
function fetcher(url, options) {
|
|
58
58
|
const shouldUseBasicAuth = !options.isExternal && HTTP_USERNAME && HTTP_PASSWORD;
|
|
59
59
|
|
|
60
|
-
const headers =
|
|
61
|
-
"User-Agent":
|
|
62
|
-
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36",
|
|
60
|
+
const headers = {
|
|
61
|
+
"User-Agent": "got",
|
|
63
62
|
Accept: "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
|
|
64
|
-
"Accept-Encoding": "gzip, deflate, br",
|
|
65
63
|
"Accept-Language": "en-US,en;q=0.9,cs-CZ;q=0.8,cs;q=0.7,de;q=0.6",
|
|
66
64
|
"Cache-Control": "no-cache",
|
|
67
65
|
Connection: "keep-alive",
|
|
@@ -75,7 +73,7 @@ function fetcher(url, options) {
|
|
|
75
73
|
"Sec-Fetch-Site": "cross-site",
|
|
76
74
|
"Sec-Fetch-User": "?1",
|
|
77
75
|
"Sec-Fetch-User-Agent": "?1",
|
|
78
|
-
}
|
|
76
|
+
};
|
|
79
77
|
|
|
80
78
|
return got(url, {
|
|
81
79
|
throwHttpErrors: false,
|
|
@@ -273,7 +271,7 @@ async function fetchUrl(url, webUrl, parentUrl = undefined, ttl = 1) {
|
|
|
273
271
|
try {
|
|
274
272
|
const response = await fetcher(url, { redirect: !!parentUrl, isExternal: !url.includes(webUrl) });
|
|
275
273
|
|
|
276
|
-
if (response.statusCode === 403 && response.headers["server"]
|
|
274
|
+
if (response.statusCode === 403 && ["cloudflare"].includes(response.headers["server"])) {
|
|
277
275
|
return {
|
|
278
276
|
url,
|
|
279
277
|
parentUrl,
|