mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-08 06:19:05 +08:00
fix: cloudflare turnstile protection error (#9663)
This commit is contained in:
parent
d4e024f42d
commit
e5327aba78
@ -10,6 +10,13 @@ export function initSessionUserAgent() {
|
|||||||
const newUA = originUA.replace(/CherryStudio\/\S+\s/, '').replace(/Electron\/\S+\s/, '')
|
const newUA = originUA.replace(/CherryStudio\/\S+\s/, '').replace(/Electron\/\S+\s/, '')
|
||||||
|
|
||||||
wvSession.setUserAgent(newUA)
|
wvSession.setUserAgent(newUA)
|
||||||
|
wvSession.webRequest.onBeforeSendHeaders((details, cb) => {
|
||||||
|
const headers = {
|
||||||
|
...details.requestHeaders,
|
||||||
|
'User-Agent': newUA
|
||||||
|
}
|
||||||
|
cb({ requestHeaders: headers })
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user