mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-24 10:40:07 +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/, '')
|
||||
|
||||
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