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:
parent
de83394e8a
commit
3be987891b
|
|
@ -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(),
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user