mirror of
https://github.com/SukkaW/Surge.git
synced 2026-02-03 12:31:54 +08:00
Chore: add fetch UA
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import type { BunFile } from 'bun';
|
||||
import { fetchWithRetry } from './fetch-retry';
|
||||
import { fetchWithRetry, defaultRequestInit } from './fetch-retry';
|
||||
|
||||
const decoder = new TextDecoder('utf-8');
|
||||
|
||||
@@ -56,6 +56,6 @@ export async function* createReadlineInterfaceFromResponse(resp: Response): Asyn
|
||||
}
|
||||
}
|
||||
|
||||
export function fetchRemoteTextAndCreateReadlineInterface(url: string | URL, opt?: RequestInit): Promise<AsyncGenerator<string>> {
|
||||
return fetchWithRetry(url, opt).then(res => createReadlineInterfaceFromResponse(res));
|
||||
export function fetchRemoteTextAndCreateReadlineInterface(url: string | URL): Promise<AsyncGenerator<string>> {
|
||||
return fetchWithRetry(url, defaultRequestInit).then(res => createReadlineInterfaceFromResponse(res));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user