Fix CORS headers for static assets (WASM/JS files)
Some checks failed
Build and Push to Harbor / build-and-push (push) Has been cancelled

Add CORS headers to static assets location block. In nginx, add_header
in a location block replaces all parent add_header directives, so the
CORS headers need to be repeated in the location block that handles
.wasm and .js files.

This fixes the issue where threaded WASM files couldn't load because
they didn't have the required Cross-Origin headers.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Neon Vortex
2025-11-23 00:19:44 -05:00
parent 2171af4150
commit 6b10a7da42

View File

@@ -37,5 +37,8 @@ server {
location ~* \.(png|jpg|jpeg|gif|ico|wasm|js|css)$ { location ~* \.(png|jpg|jpeg|gif|ico|wasm|js|css)$ {
expires 1y; expires 1y;
add_header Cache-Control "public, immutable"; add_header Cache-Control "public, immutable";
# CORS headers must be repeated here because add_header in location block overrides parent
add_header Cross-Origin-Embedder-Policy "require-corp" always;
add_header Cross-Origin-Opener-Policy "same-origin" always;
} }
} }