fix(raw-dump): add user-agent header to worker requests

Set User-Agent to csc/${version} in both auth() and authWithFallback()

Signed-off-by: 林凯90331 <90331@sangfor.com>

Co-authored-by: CoStrict <zgsm@sangfor.com.cn>
This commit is contained in:
林凯90331 2026-05-15 14:33:33 +08:00
parent de83394e8a
commit 3be987891b

View File

@ -216,6 +216,7 @@ export async function auth() {
const clientId = creds.machine_id || process.env.CSC_MACHINE_ID || 'unknown'
headers.set('zgsm-client-id', clientId)
headers.set('zgsm-client-ide', 'cli')
headers.set('User-Agent', `csc/${version}`)
const accessPayload = parseJWT(creds.access_token) as JwtPayload
let refreshPayload: JwtPayload | null = null
@ -742,6 +743,7 @@ export async function authWithFallback(): Promise<
headers.set('zgsm-client-id', clientId)
headers.set('zgsm-client-ide', 'cli')
headers.set('X-Costrict-Version', `csc-${version}`)
headers.set('User-Agent', `csc/${version}`)
return {
baseUrl: resolveRawDumpBaseUrl(),