fix: 移除一些headers以减少奇怪的502问题

This commit is contained in:
ikechan8370 2023-08-26 10:52:32 +08:00 committed by GitHub
parent d6ed1bf37f
commit 043b80ddd4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -70,25 +70,25 @@ export default class SydneyAIClient {
accept: 'application/json', accept: 'application/json',
'accept-language': 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6', 'accept-language': 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',
'content-type': 'application/json', 'content-type': 'application/json',
'sec-ch-ua': '"Microsoft Edge";v="113", "Chromium";v="113", "Not-A.Brand";v="24"', // 'sec-ch-ua': '"Microsoft Edge";v="113", "Chromium";v="113", "Not-A.Brand";v="24"',
// 'sec-ch-ua-arch': '"x86"', // 'sec-ch-ua-arch': '"x86"',
// 'sec-ch-ua-bitness': '"64"', // 'sec-ch-ua-bitness': '"64"',
// 'sec-ch-ua-full-version': '"112.0.1722.7"', // 'sec-ch-ua-full-version': '"112.0.1722.7"',
// 'sec-ch-ua-full-version-list': '"Chromium";v="112.0.5615.20", "Microsoft Edge";v="112.0.1722.7", "Not:A-Brand";v="99.0.0.0"', // 'sec-ch-ua-full-version-list': '"Chromium";v="112.0.5615.20", "Microsoft Edge";v="112.0.1722.7", "Not:A-Brand";v="99.0.0.0"',
'sec-ch-ua-mobile': '?0', // 'sec-ch-ua-mobile': '?0',
// 'sec-ch-ua-model': '', // 'sec-ch-ua-model': '',
'sec-ch-ua-platform': '"macOS"', // 'sec-ch-ua-platform': '"macOS"',
// 'sec-ch-ua-platform-version': '"15.0.0"', // 'sec-ch-ua-platform-version': '"15.0.0"',
'sec-fetch-dest': 'empty', // 'sec-fetch-dest': 'empty',
'sec-fetch-mode': 'cors', // 'sec-fetch-mode': 'cors',
'sec-fetch-site': 'same-origin', // 'sec-fetch-site': 'same-origin',
'x-ms-client-request-id': crypto.randomUUID(), // 'x-ms-client-request-id': crypto.randomUUID(),
'x-ms-useragent': 'azsdk-js-api-client-factory/1.0.0-beta.1 core-rest-pipeline/1.10.3 OS/macOS', // 'x-ms-useragent': 'azsdk-js-api-client-factory/1.0.0-beta.1 core-rest-pipeline/1.10.3 OS/macOS',
// cookie: this.opts.cookies || `_U=${this.opts.userToken}`, // cookie: this.opts.cookies || `_U=${this.opts.userToken}`,
Referer: 'https://edgeservices.bing.com/edgesvc/chat?udsframed=1&form=SHORUN&clientscopes=chat,noheader,channelstable,', Referer: 'https://edgeservices.bing.com/edgesvc/chat?udsframed=1&form=SHORUN&clientscopes=chat,noheader,channelstable,',
'Referrer-Policy': 'origin-when-cross-origin', // 'Referrer-Policy': 'origin-when-cross-origin',
// Workaround for request being blocked due to geolocation // Workaround for request being blocked due to geolocation
'x-forwarded-for': '1.1.1.1' // 'x-forwarded-for': '1.1.1.1'
} }
} }
if (this.opts.cookies || this.opts.userToken) { if (this.opts.cookies || this.opts.userToken) {