mirror of
https://github.com/chenyme/grok2api.git
synced 2026-12-06 00:01:05 +00:00
问题: 修复第一版里 _resolve_profile 优先读 proxy.clearance.user_agent(嵌套 v2 路径), fallback 才读 proxy.user_agent(扁平 v1 路径)。但 config.defaults.toml 里 proxy.clearance.user_agent 预设了占位 Chrome 136 UA(非空字符串),所以外部 cf-refresher sidecar 写到 proxy.user_agent 的新鲜 Firefox UA 永远被 defaults 盖掉。 结果 Cookie 里带的 cf_clearance 是用 Firefox UA 获取的,但实际请求 UA 变成了 Chrome 136。 Cloudflare 把 cf_clearance 绑定到首次获取时的 UA,UA 一变即 403。 修复: 扁平 legacy 路径(proxy.xxx)优先, 嵌套(proxy.clearance.xxx) 作为 fallback。 这样 cf-refresher 写扁平路径时能立即覆盖 defaults 的占位值。cf_clearance/cf_cookies 同样遵循此顺序以保持一致。