fix: serve engine modules with JavaScript MIME
This commit is contained in:
@@ -83,7 +83,7 @@ function makeLock(artifact: string, sha256: string) {
|
||||
return {
|
||||
schemaVersion: 1,
|
||||
releaseVersion: '0.1.0',
|
||||
portalVersion: '0.2.8',
|
||||
portalVersion: '0.2.9',
|
||||
catalogue: {
|
||||
id: 'de.add-ideas.toolbox',
|
||||
name: 'Test Toolbox',
|
||||
|
||||
@@ -196,6 +196,18 @@ describe('production deployment', () => {
|
||||
);
|
||||
});
|
||||
|
||||
it('serves ES modules as JavaScript before the broad static location', () => {
|
||||
const moduleLocation =
|
||||
/location ~\* \\\.mjs\$\s*\{\s*types\s*\{\s*application\/javascript mjs;\s*\}\s*try_files \$uri =404;\s*\}/mu;
|
||||
const moduleLocationIndex = nginxConfig.search(moduleLocation);
|
||||
const staticLocationIndex = nginxConfig.search(
|
||||
/location ~\* \\\.\(\?:css\|js\|mjs\|/u
|
||||
);
|
||||
|
||||
expect(moduleLocationIndex).toBeGreaterThanOrEqual(0);
|
||||
expect(staticLocationIndex).toBeGreaterThan(moduleLocationIndex);
|
||||
});
|
||||
|
||||
it('allows same-origin WebAssembly workers and local blob media previews', () => {
|
||||
expect(nginxConfig).toContain("script-src 'self' 'wasm-unsafe-eval'");
|
||||
expect(nginxConfig).toContain("worker-src 'self' blob:");
|
||||
|
||||
Reference in New Issue
Block a user