|
|
@@ -104,7 +104,22 @@ export namespace Server {
|
|
|
timer.stop()
|
|
|
}
|
|
|
})
|
|
|
- .use(cors())
|
|
|
+ .use(
|
|
|
+ cors({
|
|
|
+ origin(input) {
|
|
|
+ if (!input) return
|
|
|
+
|
|
|
+ if (input.startsWith("http://localhost:")) return input
|
|
|
+ if (input.startsWith("http://127.0.0.1:")) return input
|
|
|
+
|
|
|
+ // *.opencode.ai (https only, adjust if needed)
|
|
|
+ if (/^https:\/\/([a-z0-9-]+\.)*opencode\.ai$/.test(input)) {
|
|
|
+ return input
|
|
|
+ }
|
|
|
+ return
|
|
|
+ },
|
|
|
+ }),
|
|
|
+ )
|
|
|
.get(
|
|
|
"/global/health",
|
|
|
describeRoute({
|