mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-28 17:41:54 +08:00
Chore: use latest fetch from undici
This commit is contained in:
@@ -37,6 +37,7 @@ export const downloadPreviousBuild = task(require.main === module, __filename)(a
|
||||
// https://gitlab.com/gitlab-org/gitlab/-/commit/50c11f278d18fe1f3fb12eb595067216bb58ade2
|
||||
'sec-fetch-mode': 'same-origin'
|
||||
}
|
||||
// mode: 'same-origin'
|
||||
});
|
||||
|
||||
if (resp.status !== 200) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import retry from 'async-retry';
|
||||
import picocolors from 'picocolors';
|
||||
import { setTimeout } from 'node:timers/promises';
|
||||
import { fetch as _fetch } from 'undici';
|
||||
|
||||
function isClientError(err: unknown): err is NodeJS.ErrnoException {
|
||||
if (!err || typeof err !== 'object') return false;
|
||||
@@ -161,4 +162,4 @@ export const defaultRequestInit: RequestInit = {
|
||||
}
|
||||
};
|
||||
|
||||
export const fetchWithRetry = createFetchRetry(fetch);
|
||||
export const fetchWithRetry = createFetchRetry(_fetch as any);
|
||||
|
||||
Reference in New Issue
Block a user