From d6866052c45d5e0c26f9d66cb454a0aeaa42ca92 Mon Sep 17 00:00:00 2001 From: beyondkmp Date: Sat, 23 Aug 2025 18:59:29 +0800 Subject: [PATCH] fix: add copilot header to fix json error (#9456) * add accept type in header * add header --- src/main/services/CopilotService.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/services/CopilotService.ts b/src/main/services/CopilotService.ts index f5c773a7cc..345ff39374 100644 --- a/src/main/services/CopilotService.ts +++ b/src/main/services/CopilotService.ts @@ -68,7 +68,11 @@ class CopilotService { constructor() { this.tokenFilePath = path.join(app.getPath('userData'), '.copilot_token') - this.headers = { ...CONFIG.DEFAULT_HEADERS } + this.headers = { + ...CONFIG.DEFAULT_HEADERS, + accept: 'application/json', + 'user-agent': 'Visual Studio Code (desktop)' + } } /** @@ -93,6 +97,7 @@ class CopilotService { 'Sec-Fetch-Site': 'none', 'Sec-Fetch-Mode': 'no-cors', 'Sec-Fetch-Dest': 'empty', + accept: 'application/json', authorization: `token ${token}` } })