fix: 修复 OpenCode 运行时启动与本地打包
This commit is contained in:
@@ -76,7 +76,7 @@ export function startHostApiServer(ctx: HostApiContext, port = getPort('NIANCODE
|
||||
// Set origin-aware CORS headers early so every response
|
||||
// (including error responses) carries them consistently.
|
||||
const origin = req.headers.origin;
|
||||
setCorsHeaders(res, origin);
|
||||
setCorsHeaders(res, origin, ctx.opencodeManager.getStatus().url);
|
||||
|
||||
// CORS preflight — respond before auth so browsers can negotiate.
|
||||
if (req.method === 'OPTIONS') {
|
||||
|
||||
Reference in New Issue
Block a user