@lvce-editor/renderer-process 6.2.0 → 6.3.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.
|
@@ -11443,6 +11443,11 @@ const tryToGetActualErrorMessage$1 = async ({
|
|
|
11443
11443
|
return `Failed to import ${url}: Unknown Network Error (${response.status})`;
|
|
11444
11444
|
};
|
|
11445
11445
|
|
|
11446
|
+
const javaScriptContentTypes = ['application/javascript', 'text/javascript', 'application/javascript; charset=UTF-8'];
|
|
11447
|
+
const isJavaScriptContentType = contentType => {
|
|
11448
|
+
return javaScriptContentTypes.includes(contentType);
|
|
11449
|
+
};
|
|
11450
|
+
|
|
11446
11451
|
const tryToGetActualErrorMessage = async ({
|
|
11447
11452
|
url,
|
|
11448
11453
|
name
|
|
@@ -11456,7 +11461,7 @@ const tryToGetActualErrorMessage = async ({
|
|
|
11456
11461
|
}
|
|
11457
11462
|
if (response.ok) {
|
|
11458
11463
|
const contentType = response.headers.get('Content-Type');
|
|
11459
|
-
if (contentType
|
|
11464
|
+
if (!isJavaScriptContentType(contentType)) {
|
|
11460
11465
|
return `Failed to start ${displayName}: Content type for worker must be application/javascript but is ${contentType}`;
|
|
11461
11466
|
}
|
|
11462
11467
|
const crossOriginEmbedderPolicy = response.headers.get('Cross-Origin-Embedder-Policy');
|