Skip to content

Commit e6d627c

Browse files
authored
Merge pull request #4889 from continuedev/nate/fetch-localhost-update
replace localhost host with 127.0.0.1
2 parents 9555650 + 7c1e082 commit e6d627c

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

packages/fetch/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@continuedev/fetch",
3-
"version": "1.0.4",
3+
"version": "1.0.5",
44
"description": "",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

packages/fetch/src/fetch.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ export function fetchwithRequestOptions(
1515
init?: RequestInit,
1616
requestOptions?: RequestOptions,
1717
): Promise<Response> {
18-
let url = url_;
19-
if (typeof url === "string") {
20-
url = new URL(url);
18+
const url = typeof url_ === "string" ? new URL(url_) : url_;
19+
if (url.host === "localhost") {
20+
url.host = "127.0.0.1";
2121
}
2222

2323
const TIMEOUT = 7200; // 7200 seconds = 2 hours

packages/fetch/src/stream.ts

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ export async function* toAsyncIterable(
22
nodeReadable: NodeJS.ReadableStream,
33
): AsyncGenerator<Uint8Array> {
44
for await (const chunk of nodeReadable) {
5+
// @ts-expect-error
56
yield chunk as Uint8Array;
67
}
78
}

0 commit comments

Comments
 (0)