Skip to content

#75 合并前需修两处:workflow_run / ai 两个 router 注册被删除,CORS 通配配 credentials #143

Description

@johnnyzhang-eng

现象

PR #75 的分支 xiaocheny214/DireSoul:feat/backend-dev 上有两处需要在合并前修掉。均在 4ee4236 核实。

一、workflow_run / ai 两个 router 的注册被删除(回归)

该分支已包含最新 main(git merge-base --is-ancestor origin/main HEAD 为真),而相对 main 的 diff 里:

-from windup_app.web.api.agent import router as ai_router
-from windup_app.web.api.workflow_run import router as workflow_run_router
     ...
-    app.include_router(workflow_run_router)
-    app.include_router(ai_router)

4246389#76,2026-08-06 14:52 合入 main)刚把这两个 router 加上。#75 合并后 /workflow-runs/ai/chat 由可用变 404,而 web/api/workflow_run.pyweb/api/agent.py 仍在仓库里,静默失效无任何报错。推测是合并 main 时解冲突丢的。

二、CORS 两处

bootstrap/app.pycreate_app()

  • allow_origin_regex=r"https://.*\.vercel\.app"allow_credentials=True,等于对任意 vercel.app 应用放行带凭证跨域;且它与显式白名单是并列关系,配了 WINDUP_CORS_ORIGINS 也关不掉
  • 默认来源列表缺 4173(vite preview,本地跑生产构建用的端口)

本项目鉴权走 Authorization: Bearer(前端无 credentials: 'include',后端无 set_cookie),allow_credentials 可直接置 False;CORS 的 credentials 只管 cookie 与 TLS 客户端证书。关掉后通配不再构成风险。

验收

  • GET /openapi.json 中存在 /workflow-runs/ai/chat
  • 响应不再携带 access-control-allow-credentials
  • 4173 来源可过预检

备注

修复走 xiaocheny214/DireSoul:feat/backend-dev#75 的 head 分支),合入后自动出现在 #75

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions