fix: serve engine modules with JavaScript MIME
This commit is contained in:
@@ -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