@lvce-editor/shared-process 0.30.8 → 0.31.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.
- package/package.json +5 -5
- package/src/parts/ContentSecurityPolicyDocument/ContentSecurityPolicyDocument.js +1 -0
- package/src/parts/ContentSecurityPolicyEditorWorker/ContentSecurityPolicyEditorWorker.js +1 -1
- package/src/parts/CrossOriginResourcePolicy/CrossOriginResourcePolicy.js +1 -0
- package/src/parts/GetElectronFileResponse/GetElectronFileResponse.js +2 -1
- package/src/parts/GetNotModifiedResponse/GetNotModifiedResponse.js +2 -2
- package/src/parts/GetTestRequestResponse/GetTestRequestResponse.js +6 -2
- package/src/parts/HandleRemoteRequest/HandleRemoteRequest.js +2 -0
- package/src/parts/HttpHeader/HttpHeader.js +1 -0
- package/src/parts/Platform/Platform.js +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvce-editor/shared-process",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.31.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@lvce-editor/assert": "^1.2.0",
|
|
21
|
-
"@lvce-editor/extension-host-helper-process": "0.
|
|
21
|
+
"@lvce-editor/extension-host-helper-process": "0.31.0",
|
|
22
22
|
"@lvce-editor/ipc": "^9.3.0",
|
|
23
23
|
"@lvce-editor/json-rpc": "^1.4.0",
|
|
24
24
|
"@lvce-editor/jsonc-parser": "^1.4.0",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"xdg-basedir": "^5.1.0"
|
|
30
30
|
},
|
|
31
31
|
"optionalDependencies": {
|
|
32
|
-
"@lvce-editor/network-process": "^1.
|
|
33
|
-
"@lvce-editor/preload": "^1.
|
|
32
|
+
"@lvce-editor/network-process": "^1.6.0",
|
|
33
|
+
"@lvce-editor/preload": "^1.4.0",
|
|
34
34
|
"@lvce-editor/search-process": "^1.2.0",
|
|
35
35
|
"@lvce-editor/typescript-compile-process": "^1.2.0",
|
|
36
36
|
"@lvce-editor/pty-host": "^1.2.0",
|
|
@@ -38,6 +38,6 @@
|
|
|
38
38
|
"open": "^10.1.0",
|
|
39
39
|
"tail": "^2.2.6",
|
|
40
40
|
"tmp-promise": "^3.0.3",
|
|
41
|
-
"trash": "^
|
|
41
|
+
"trash": "^9.0.0"
|
|
42
42
|
}
|
|
43
43
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import * as GetContentSecurityPolicy from '../GetContentSecurityPolicy/GetContentSecurityPolicy.js';
|
|
2
|
-
export const value = GetContentSecurityPolicy.getContentSecurityPolicy([`default-src 'none'`, `script-src 'self'`]);
|
|
2
|
+
export const value = GetContentSecurityPolicy.getContentSecurityPolicy([`default-src 'none'`, `script-src 'self'`, `font-src 'self'`]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const value = 'cross-origin';
|
|
@@ -19,7 +19,8 @@ export const getElectronFileResponse = async (url, request) => {
|
|
|
19
19
|
const stats = await stat(absolutePath);
|
|
20
20
|
etag = GetEtag.getEtag(stats);
|
|
21
21
|
if (request.headers['if-none-match'] === etag) {
|
|
22
|
-
|
|
22
|
+
const headers = GetHeaders.getHeaders(absolutePath, pathName);
|
|
23
|
+
return GetNotModifiedResponse.getNotModifiedResponse(headers);
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
26
|
const content = await GetElectronFileResponseContent.getElectronFileResponseContent(request, absolutePath, url);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as HttpStatusCode from '../HttpStatusCode/HttpStatusCode.js';
|
|
2
|
-
export const getNotModifiedResponse = async () => {
|
|
2
|
+
export const getNotModifiedResponse = async (headers = {}) => {
|
|
3
3
|
return {
|
|
4
4
|
body: '',
|
|
5
5
|
init: {
|
|
6
6
|
status: HttpStatusCode.NotModifed,
|
|
7
|
-
headers
|
|
7
|
+
headers,
|
|
8
8
|
},
|
|
9
9
|
};
|
|
10
10
|
};
|
|
@@ -3,9 +3,10 @@ import { join } from 'node:path';
|
|
|
3
3
|
import * as CreateTestOverview from '../CreateTestOverview/CreateTestOverview.js';
|
|
4
4
|
import * as CrossOriginEmbedderPolicy from '../CrossOriginEmbedderPolicy/CrossOriginEmbedderPolicy.js';
|
|
5
5
|
import * as CrossOriginOpenerPolicy from '../CrossOriginOpenerPolicy/CrossOriginOpenerPolicy.js';
|
|
6
|
-
import * as
|
|
6
|
+
import * as CrossOriginResourcePolicy from '../CrossOriginResourcePolicy/CrossOriginResourcePolicy.js';
|
|
7
7
|
import * as GetPathName from '../GetPathName/GetPathName.js';
|
|
8
8
|
import * as GetTestPath from '../GetTestPath/GetTestPath.js';
|
|
9
|
+
import * as HttpHeader from '../HttpHeader/HttpHeader.js';
|
|
9
10
|
import * as HttpStatusCode from '../HttpStatusCode/HttpStatusCode.js';
|
|
10
11
|
export const getTestRequestResponse = async (request, indexHtmlPath) => {
|
|
11
12
|
const pathName = GetPathName.getPathName(request);
|
|
@@ -15,7 +16,10 @@ export const getTestRequestResponse = async (request, indexHtmlPath) => {
|
|
|
15
16
|
body,
|
|
16
17
|
init: {
|
|
17
18
|
status: HttpStatusCode.Ok,
|
|
18
|
-
headers: {
|
|
19
|
+
headers: {
|
|
20
|
+
[HttpHeader.CrossOriginEmbedderPolicy]: CrossOriginEmbedderPolicy.value,
|
|
21
|
+
[HttpHeader.CrossOriginResourcePolicy]: CrossOriginResourcePolicy.value,
|
|
22
|
+
},
|
|
19
23
|
},
|
|
20
24
|
};
|
|
21
25
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as Assert from '../Assert/Assert.js';
|
|
2
2
|
import * as GetElectronFileResponse from '../GetElectronFileResponse/GetElectronFileResponse.js';
|
|
3
|
+
import * as HandleSocketError from '../HandleSocketError/HandleSocketError.js';
|
|
3
4
|
import * as HttpServerResponse from '../HttpServerResponse/HttpServerResponse.js';
|
|
4
5
|
export const handleRemoteRequest = async (socket, request) => {
|
|
5
6
|
Assert.object(socket);
|
|
6
7
|
Assert.object(request);
|
|
8
|
+
socket.on('error', HandleSocketError.handleSocketError);
|
|
7
9
|
const result = await GetElectronFileResponse.getElectronFileResponse(request.url, request);
|
|
8
10
|
HttpServerResponse.send(request, socket, result);
|
|
9
11
|
};
|
|
@@ -3,5 +3,6 @@ export const ContentType = 'Content-Type';
|
|
|
3
3
|
export const ContentSecurityPolicy = 'Content-Security-Policy';
|
|
4
4
|
export const CrossOriginEmbedderPolicy = 'Cross-Origin-Embedder-Policy';
|
|
5
5
|
export const CrossOriginOpenerPolicy = 'Cross-Origin-Opener-Policy';
|
|
6
|
+
export const CrossOriginResourcePolicy = 'Cross-Origin-Resource-Policy';
|
|
6
7
|
export const Etag = 'Etag';
|
|
7
8
|
export const IfNotMatch = 'if-none-match';
|
|
@@ -41,9 +41,9 @@ export const getAppImageName = () => {
|
|
|
41
41
|
export const getSetupName = () => {
|
|
42
42
|
return 'Lvce-Setup';
|
|
43
43
|
};
|
|
44
|
-
export const version = '0.
|
|
45
|
-
export const commit = '
|
|
46
|
-
export const date = '2024-07-
|
|
44
|
+
export const version = '0.31.0';
|
|
45
|
+
export const commit = '2ce7ab1';
|
|
46
|
+
export const date = '2024-07-26T18:22:29.000Z';
|
|
47
47
|
export const getVersion = () => {
|
|
48
48
|
return version;
|
|
49
49
|
};
|