more default headers (#749)

This commit is contained in:
nyagami
2024-02-07 18:54:17 +07:00
committed by GitHub
parent 80ef523595
commit f4b431f119
+12 -2
View File
@@ -11,10 +11,20 @@ type FetchInit = {
}; };
const makeInit = async (init?: FetchInit) => { const makeInit = async (init?: FetchInit) => {
let defaultHeaders: Record<string, string> = {}; let defaultHeaders: Record<string, string> = {
'Connection': 'keep-alive',
'Accept': '*/*',
'Accept-Language': '*',
'Sec-Fetch-Mode': 'cors',
'Accept-Encoding': 'gzip, deflate',
'Cache-Control': 'max-age=0',
};
try { try {
const { getHeaders } = await import("../index.js"); const { getHeaders } = await import("../index.js");
defaultHeaders = getHeaders(); defaultHeaders = {
...defaultHeaders,
...getHeaders()
};
} catch { } catch {
// nothing to do // nothing to do
} }