Chore: add fetch UA

This commit is contained in:
SukkaW
2023-11-20 15:45:44 +08:00
parent 5ea91fa9a4
commit 0bdc69523a
8 changed files with 25 additions and 14 deletions

View File

@@ -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));
}