@uxf/scripts 11.64.2 → 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxf/scripts",
3
- "version": "11.64.2",
3
+ "version": "11.67.1",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -57,9 +57,8 @@ function getUrlOrigin(url) {
57
57
  function fetcher(url, options) {
58
58
  const shouldUseBasicAuth = !options.isExternal && HTTP_USERNAME && HTTP_PASSWORD;
59
59
 
60
- const headers = new 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
63
  "Accept-Language": "en-US,en;q=0.9,cs-CZ;q=0.8,cs;q=0.7,de;q=0.6",
65
64
  "Cache-Control": "no-cache",
@@ -74,7 +73,7 @@ function fetcher(url, options) {
74
73
  "Sec-Fetch-Site": "cross-site",
75
74
  "Sec-Fetch-User": "?1",
76
75
  "Sec-Fetch-User-Agent": "?1",
77
- });
76
+ };
78
77
 
79
78
  return got(url, {
80
79
  throwHttpErrors: false,
@@ -272,7 +271,7 @@ async function fetchUrl(url, webUrl, parentUrl = undefined, ttl = 1) {
272
271
  try {
273
272
  const response = await fetcher(url, { redirect: !!parentUrl, isExternal: !url.includes(webUrl) });
274
273
 
275
- if (response.statusCode === 403 && response.headers["server"] === "cloudflare") {
274
+ if (response.statusCode === 403 && ["cloudflare"].includes(response.headers["server"])) {
276
275
  return {
277
276
  url,
278
277
  parentUrl,