Skip to content

Commit 105c40a

Browse files
hyperpolymathclaude
andcommitted
fix(nqc): document wildcard CORS in proxy and add ALLOWED_ORIGINS env
NQC proxy is a localhost dev tool — wildcard CORS is intentional but now documented with ALLOWED_ORIGINS env var for non-dev deployments. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 5fbbf33 commit 105c40a

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

nqc/web/proxy/server.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,13 @@ const PORT_MAP = {
3232
kql: 8082,
3333
};
3434

35-
// CORS headers added to every proxied response
35+
// CORS headers added to every proxied response.
36+
// Wildcard origin is intentional: this is a localhost-only dev proxy bridging
37+
// the browser to database engines on different ports. For non-dev deployments,
38+
// set ALLOWED_ORIGINS to a comma-separated list of permitted origins.
39+
const ALLOWED_ORIGIN = Deno.env.get("ALLOWED_ORIGINS") || "*";
3640
const CORS_HEADERS = {
37-
"Access-Control-Allow-Origin": "*",
41+
"Access-Control-Allow-Origin": ALLOWED_ORIGIN,
3842
"Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, OPTIONS",
3943
"Access-Control-Allow-Headers": "Content-Type, Authorization",
4044
"Access-Control-Max-Age": "86400",

0 commit comments

Comments
 (0)