Skip to content

Commit ac66a50

Browse files
vveerrggclaude
andcommitted
fix: use undefined instead of false for corsOrigins type compatibility
The NostrConfig type allows string[] | "*" | undefined for corsOrigins, but the fallback was set to false which caused a TypeScript build error. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 56b14d0 commit ac66a50

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/config/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export const config: NostrConfig = {
3535
port: parseInt(process.env.PORT || '3002'),
3636
nodeEnv: process.env.NODE_ENV || 'development',
3737
// SECURITY: Do not default to '*' — require explicit CORS_ORIGINS configuration.
38-
corsOrigins: process.env.CORS_ORIGINS?.split(',') || false,
38+
corsOrigins: process.env.CORS_ORIGINS?.split(',') || undefined,
3939
security: {
4040
trustedProxies: process.env.TRUSTED_PROXIES?.split(',') || false,
4141
allowedIPs: process.env.ALLOWED_IPS?.split(',') || [],
@@ -96,7 +96,7 @@ export async function loadConfig(envPath?: string): Promise<NostrConfig> {
9696
port: parseInt(process.env.PORT || '3002'),
9797
nodeEnv: process.env.NODE_ENV || 'development',
9898
// SECURITY: Do not default to '*' — require explicit CORS_ORIGINS configuration.
99-
corsOrigins: process.env.CORS_ORIGINS?.split(',') || false,
99+
corsOrigins: process.env.CORS_ORIGINS?.split(',') || undefined,
100100
security: {
101101
trustedProxies: process.env.TRUSTED_PROXIES?.split(',') || false,
102102
allowedIPs: process.env.ALLOWED_IPS?.split(',') || [],

0 commit comments

Comments
 (0)