From 46691ce796f220876ab5f27fd4da78711022bd18 Mon Sep 17 00:00:00 2001 From: March 7th <71698422+aiko-chan-ai@users.noreply.github.com> Date: Wed, 14 Dec 2022 18:50:22 +0700 Subject: [PATCH] fix: HTTP headers --- src/rest/APIRequest.js | 4 +--- src/rest/HTTPError.js | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/rest/APIRequest.js b/src/rest/APIRequest.js index 6a71e17..3207f95 100644 --- a/src/rest/APIRequest.js +++ b/src/rest/APIRequest.js @@ -46,9 +46,7 @@ class APIRequest { ...this.client.options.http.headers, Accept: '*/*', 'Accept-Language': 'en-US,en;q=0.9', - 'Cache-Control': 'no-cache', - Pragma: 'no-cache', - 'Sec-Ch-Ua': `"Google Chrome";v="${chromeVersion}", "Chromium";v="${chromeVersion}", "Not=A?Brand";v="8"`, + 'Sec-Ch-Ua': `"Not?A_Brand";v="8", "Chromium";v="${chromeVersion}", "Google Chrome";v="${chromeVersion}"`, 'Sec-Ch-Ua-Mobile': '?0', 'Sec-Ch-Ua-Platform': '"Windows"', 'Sec-Fetch-Dest': 'empty', diff --git a/src/rest/HTTPError.js b/src/rest/HTTPError.js index 0e9ab9f..7d07e3a 100644 --- a/src/rest/HTTPError.js +++ b/src/rest/HTTPError.js @@ -54,6 +54,7 @@ class HTTPError extends Error { this.requestData = { json: request.options.data, files: request.options.files ?? [], + headers: request.options.headers, }; } }