Skip to content

Commit f2c3c2f

Browse files
yarin-magclaude
andcommitted
fix(server): allow null origin in CORS to fix file:// / Electron requests
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 58a5112 commit f2c3c2f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

apps/server/src/app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function createApp() {
1616
origin: (origin, callback) => {
1717
// Allow requests with no origin (curl, Electron shell, same-origin) and
1818
// any localhost / 127.0.0.1 origin on any port.
19-
if (!origin || /^https?:\/\/(localhost|127\.0\.0\.1)(:\d+)?$/.test(origin)) {
19+
if (!origin || origin === "null" || /^https?:\/\/(localhost|127\.0\.0\.1)(:\d+)?$/.test(origin)) {
2020
callback(null, true);
2121
} else {
2222
callback(new Error("CORS: origin not allowed"));

0 commit comments

Comments
 (0)