fix(deploy): /api/* 与 /internal/* 显式 run_worker_first,修 OAuth 回调被 SPA 资源层截胡
compatibility_date >= 2025-04-01 隐式开启 assets_navigation_prefers_asset_serving: 浏览器【导航请求】不进入 Worker,直接由 SPA 资源层返回 index.html。 /api/oauth/cloudflare/callback 是浏览器跨站重定向的落点(导航请求),于是被截胡 —— 前端在无匹配路由的路径上 hydrate,渲染 React Router 的 404 页面;后端 state 完全没被消费, 表现为「Cloudflare 授权成功,回调却毫无反应」。 用 run_worker_first 路径数组(而非 true),静态资源仍走 asset-first 快路径。 - 新增 tests/deploy_config.test.ts 锁住这条部署配置(此类问题只在生产出现) - 线上复验:导航请求打回调现在返回 Worker 的 400,不再是 200 index.html;/accounts 仍返回 SPA
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "wmailhub",
|
||||
"version": "2.3.3",
|
||||
"version": "2.3.4",
|
||||
"description": "WmailHub - 基于 Cloudflare Email Workers 的轻量邮件接收与转发平台(Console 直连 Email Worker)",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
|
||||
Reference in New Issue
Block a user