mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-21 14:42:20 +03:00
fix(claude-web): inject cf_clearance into cookie for 403 prevention (#3046)
The execute() and testConnection() methods called normalizeClaudeSessionCookie() which does NOT inject cf_clearance. Cloudflare pins cf_clearance to TLS fingerprint — without it, requests get challenged with 403 even with valid session cookies. Changed both call sites to use normalizeClaudeSessionCookieWithAutoRefresh() which auto-injects cf_clearance via Turnstile solver when missing. Fixes: [403]: Claude Web API error: Co-authored-by: oyi77 <oyi77@users.noreply.github.com>
This commit is contained in:
@@ -417,7 +417,7 @@ export class ClaudeWebExecutor extends BaseExecutor {
|
||||
return false;
|
||||
}
|
||||
|
||||
const cookieHeader = normalizeClaudeSessionCookie(rawCookie);
|
||||
const cookieHeader = await normalizeClaudeSessionCookieWithAutoRefresh(rawCookie, { allowAutoSolve: false });
|
||||
const deviceId = (credentials as any)?.deviceId as string | undefined;
|
||||
|
||||
return await verifyCookieValidity(cookieHeader, deviceId, signal);
|
||||
@@ -479,7 +479,7 @@ export class ClaudeWebExecutor extends BaseExecutor {
|
||||
};
|
||||
}
|
||||
|
||||
const cookieHeader = normalizeClaudeSessionCookie(rawCookie);
|
||||
const cookieHeader = await normalizeClaudeSessionCookieWithAutoRefresh(rawCookie, { log });
|
||||
const deviceId = (credentials as any)?.deviceId as string | undefined;
|
||||
|
||||
// Transform request to Claude format
|
||||
|
||||
Reference in New Issue
Block a user