@tramvai/module-render 4.24.1 → 4.25.0
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.
|
@@ -2,11 +2,18 @@ import fetch from 'node-fetch';
|
|
|
2
2
|
|
|
3
3
|
const thirtySeconds = 1000 * 30;
|
|
4
4
|
const getFileContentLength = async (url) => {
|
|
5
|
-
const info = await fetch(url, {
|
|
5
|
+
const info = await fetch(url, {
|
|
6
|
+
method: 'HEAD',
|
|
7
|
+
timeout: thirtySeconds,
|
|
8
|
+
headers: { 'x-tramvai-service-name': 'RESOURCE_INLINER' },
|
|
9
|
+
});
|
|
6
10
|
return info.headers.get('content-length');
|
|
7
11
|
};
|
|
8
12
|
const getFile = async (url) => {
|
|
9
|
-
const fileResponse = await fetch(url, {
|
|
13
|
+
const fileResponse = await fetch(url, {
|
|
14
|
+
timeout: thirtySeconds,
|
|
15
|
+
headers: { 'x-tramvai-service-name': 'RESOURCE_INLINER' },
|
|
16
|
+
});
|
|
10
17
|
if (fileResponse.ok) {
|
|
11
18
|
const file = await fileResponse.text();
|
|
12
19
|
return file;
|
|
@@ -10,11 +10,18 @@ var fetch__default = /*#__PURE__*/_interopDefaultLegacy(fetch);
|
|
|
10
10
|
|
|
11
11
|
const thirtySeconds = 1000 * 30;
|
|
12
12
|
const getFileContentLength = async (url) => {
|
|
13
|
-
const info = await fetch__default["default"](url, {
|
|
13
|
+
const info = await fetch__default["default"](url, {
|
|
14
|
+
method: 'HEAD',
|
|
15
|
+
timeout: thirtySeconds,
|
|
16
|
+
headers: { 'x-tramvai-service-name': 'RESOURCE_INLINER' },
|
|
17
|
+
});
|
|
14
18
|
return info.headers.get('content-length');
|
|
15
19
|
};
|
|
16
20
|
const getFile = async (url) => {
|
|
17
|
-
const fileResponse = await fetch__default["default"](url, {
|
|
21
|
+
const fileResponse = await fetch__default["default"](url, {
|
|
22
|
+
timeout: thirtySeconds,
|
|
23
|
+
headers: { 'x-tramvai-service-name': 'RESOURCE_INLINER' },
|
|
24
|
+
});
|
|
18
25
|
if (fileResponse.ok) {
|
|
19
26
|
const file = await fileResponse.text();
|
|
20
27
|
return file;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/module-render",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.25.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"browser": "lib/browser.js",
|
|
6
6
|
"main": "lib/server.js",
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
"@tinkoff/layout-factory": "0.5.1",
|
|
27
27
|
"@tinkoff/errors": "0.5.1",
|
|
28
28
|
"@tinkoff/url": "0.10.1",
|
|
29
|
-
"@tinkoff/user-agent": "0.6.
|
|
30
|
-
"@tramvai/module-client-hints": "4.
|
|
31
|
-
"@tramvai/module-router": "4.
|
|
32
|
-
"@tramvai/react": "4.
|
|
29
|
+
"@tinkoff/user-agent": "0.6.79",
|
|
30
|
+
"@tramvai/module-client-hints": "4.25.0",
|
|
31
|
+
"@tramvai/module-router": "4.25.0",
|
|
32
|
+
"@tramvai/react": "4.25.0",
|
|
33
33
|
"@tramvai/safe-strings": "0.7.2",
|
|
34
|
-
"@tramvai/tokens-render": "4.
|
|
35
|
-
"@tramvai/experiments": "4.
|
|
34
|
+
"@tramvai/tokens-render": "4.25.0",
|
|
35
|
+
"@tramvai/experiments": "4.25.0",
|
|
36
36
|
"@types/loadable__server": "^5.12.6",
|
|
37
37
|
"node-fetch": "^2.6.1"
|
|
38
38
|
},
|
|
@@ -40,14 +40,14 @@
|
|
|
40
40
|
"@tinkoff/dippy": "0.10.8",
|
|
41
41
|
"@tinkoff/utils": "^2.1.2",
|
|
42
42
|
"@tinkoff/react-hooks": "0.3.1",
|
|
43
|
-
"@tramvai/cli": "4.
|
|
44
|
-
"@tramvai/core": "4.
|
|
45
|
-
"@tramvai/module-common": "4.
|
|
46
|
-
"@tramvai/state": "4.
|
|
47
|
-
"@tramvai/test-helpers": "4.
|
|
48
|
-
"@tramvai/tokens-common": "4.
|
|
49
|
-
"@tramvai/tokens-router": "4.
|
|
50
|
-
"@tramvai/tokens-server-private": "4.
|
|
43
|
+
"@tramvai/cli": "4.25.0",
|
|
44
|
+
"@tramvai/core": "4.25.0",
|
|
45
|
+
"@tramvai/module-common": "4.25.0",
|
|
46
|
+
"@tramvai/state": "4.25.0",
|
|
47
|
+
"@tramvai/test-helpers": "4.25.0",
|
|
48
|
+
"@tramvai/tokens-common": "4.25.0",
|
|
49
|
+
"@tramvai/tokens-router": "4.25.0",
|
|
50
|
+
"@tramvai/tokens-server-private": "4.25.0",
|
|
51
51
|
"express": "^4.17.1",
|
|
52
52
|
"prop-types": "^15.6.2",
|
|
53
53
|
"react": ">=16.14.0",
|