From 7c1e082535426596347d30aeb4c77e2bd11b22d4 Mon Sep 17 00:00:00 2001 From: Nate Date: Fri, 28 Mar 2025 14:54:02 -0700 Subject: [PATCH] replace localhost host with 127.0.0.1 --- packages/fetch/package.json | 2 +- packages/fetch/src/fetch.ts | 6 +++--- packages/fetch/src/stream.ts | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/fetch/package.json b/packages/fetch/package.json index 6a7097284..e0a924706 100644 --- a/packages/fetch/package.json +++ b/packages/fetch/package.json @@ -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", diff --git a/packages/fetch/src/fetch.ts b/packages/fetch/src/fetch.ts index 01fc631db..d4e8145d0 100644 --- a/packages/fetch/src/fetch.ts +++ b/packages/fetch/src/fetch.ts @@ -15,9 +15,9 @@ export function fetchwithRequestOptions( init?: RequestInit, requestOptions?: RequestOptions, ): Promise { - 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 diff --git a/packages/fetch/src/stream.ts b/packages/fetch/src/stream.ts index d0e8e4633..7f33e377d 100644 --- a/packages/fetch/src/stream.ts +++ b/packages/fetch/src/stream.ts @@ -2,6 +2,7 @@ export async function* toAsyncIterable( nodeReadable: NodeJS.ReadableStream, ): AsyncGenerator { for await (const chunk of nodeReadable) { + // @ts-expect-error yield chunk as Uint8Array; } }