diff options
author | Ajay <[email protected]> | 2024-09-02 02:04:32 -0400 |
---|---|---|
committer | Ajay <[email protected]> | 2024-09-02 02:04:32 -0400 |
commit | e181c64775d7bec43901e3a88c107ba96a0d54ce (patch) | |
tree | e83569e032e744456e898116d64e6b032024b001 /src/utils | |
parent | ac9b2d12fe63537a213b7bba5205c2f039e5e251 (diff) | |
download | SponsorBlock-e181c64775d7bec43901e3a88c107ba96a0d54ce.tar.gz SponsorBlock-e181c64775d7bec43901e3a88c107ba96a0d54ce.zip |
Use consistent request url for better caching
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/requests.ts | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/utils/requests.ts b/src/utils/requests.ts index 8c160eb0..acbde374 100644 --- a/src/utils/requests.ts +++ b/src/utils/requests.ts @@ -9,8 +9,8 @@ import { FetchResponse, sendRequestToCustomServer } from "../../maze-utils/src/b * @param address The address to add to the SponsorBlock server address * @param callback */ -export function asyncRequestToCustomServer(type: string, url: string, data = {}): Promise<FetchResponse> { - return sendRequestToCustomServer(type, url, data); +export function asyncRequestToCustomServer(type: string, url: string, data = {}, headers = {}): Promise<FetchResponse> { + return sendRequestToCustomServer(type, url, data, headers); } /** @@ -20,10 +20,12 @@ export function asyncRequestToCustomServer(type: string, url: string, data = {}) * @param address The address to add to the SponsorBlock server address * @param callback */ -export async function asyncRequestToServer(type: string, address: string, data = {}): Promise<FetchResponse> { +export async function asyncRequestToServer(type: string, address: string, data = {}, headers = {}): Promise<FetchResponse> { const serverAddress = Config.config.testingServer ? CompileConfig.testingServerAddress : Config.config.serverAddress; - return await (asyncRequestToCustomServer(type, serverAddress + address, data)); + console.log(address, headers) + + return await (asyncRequestToCustomServer(type, serverAddress + address, data, headers)); } /** |