@uxf/scripts 1.6.1 → 1.6.2

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": "1.6.1",
3
+ "version": "1.6.2",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {
package/src/Sitemap.js CHANGED
@@ -1,3 +1,4 @@
1
+ const https = require('https');
1
2
  const { create } = require("axios");
2
3
  const cheerio = require("cheerio");
3
4
 
@@ -16,6 +17,10 @@ async function getSitemap(xml) {
16
17
  return urls;
17
18
  }
18
19
 
20
+ const agent = new https.Agent({
21
+ rejectUnauthorized: false
22
+ });
23
+
19
24
  const axios = create({
20
25
  auth:
21
26
  HTTP_PASSWORD && HTTP_USERNAME
@@ -27,14 +32,14 @@ const axios = create({
27
32
  withCredentials: true,
28
33
  maxRedirects: 0,
29
34
  timeout: 20000,
35
+ httpsAgent: agent,
30
36
  headers: {
31
37
  'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36',
32
38
  'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
33
39
  'Accept-Encoding': 'gzip, deflate, br',
34
- 'Accept-Language': 'en-US,en;q=0.9',
40
+ 'Accept-Language': 'en-US,en;q=0.9,cs-CZ;q=0.8,cs;q=0.7,de;q=0.6',
35
41
  'Cache-Control': 'no-cache',
36
42
  'Connection': 'keep-alive',
37
- 'DNT': '1',
38
43
  'Pragma': 'no-cache',
39
44
  'Sec-Ch-Ua': '"Google Chrome";v="111", "Not(A:Brand";v="8", "Chromium";v="111"',
40
45
  'Sec-Ch-Ua-Arch': '"x86"',
@@ -45,9 +50,6 @@ const axios = create({
45
50
  'Sec-Fetch-Site': 'cross-site',
46
51
  'Sec-Fetch-User': '?1',
47
52
  'Sec-Fetch-User-Agent': '?1',
48
- 'TE': 'Trailers',
49
- 'Upgrade-Insecure-Requests': '1',
50
- 'X-Requested-With': 'XMLHttpRequest',
51
53
  },
52
54
  });
53
55
 
@@ -347,11 +347,13 @@ async function sendSlackMessage(errorText, slackChannel) {
347
347
  }
348
348
 
349
349
  /**
350
+ *
351
+ * @param resultErrors {string}
350
352
  * @return {Promise<void>}
351
353
  */
352
354
  async function sendGoogleChatMessage(resultErrors) {
353
355
  await GoogleChat.chatPostMessage({
354
- text: "*Odkazy uvedené v sitemap.xml nejsou dostupné*\n" + resultErrors.map(r => `${r.url} ${r.status}`).join('\n')
356
+ text: resultErrors
355
357
  });
356
358
  }
357
359