replace localhost host with 127.0.0.1

This commit is contained in:
Nate 2025-03-28 14:54:02 -07:00
parent 994dbaf3de
commit 7c1e082535
3 changed files with 5 additions and 4 deletions

View file

@ -1,6 +1,6 @@
{
"name": "@continuedev/fetch",
"version": "1.0.4",
"version": "1.0.5",
"description": "",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View file

@ -15,9 +15,9 @@ export function fetchwithRequestOptions(
init?: RequestInit,
requestOptions?: RequestOptions,
): Promise<Response> {
let url = url_;
if (typeof url === "string") {
url = new URL(url);
const url = typeof url_ === "string" ? new URL(url_) : url_;
if (url.host === "localhost") {
url.host = "127.0.0.1";
}
const TIMEOUT = 7200; // 7200 seconds = 2 hours

View file

@ -2,6 +2,7 @@ export async function* toAsyncIterable(
nodeReadable: NodeJS.ReadableStream,
): AsyncGenerator<Uint8Array> {
for await (const chunk of nodeReadable) {
// @ts-expect-error
yield chunk as Uint8Array;
}
}