Skip to content

Commit 94a5eba

Browse files
committed
Fixed fetch-agent bug
1 parent ad8202a commit 94a5eba

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/sdk/src/utils/fetch-agent.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ export class FetchAgent extends Agent {
1818
const fakeSocket = new net.Socket({ writable: false });
1919
fakeSocket.readable = true;
2020

21-
const resp = await this.fetchFn((<any>opts).href, {
21+
const url: string =
22+
(<any>opts).href ||
23+
`${req.protocol}//${(<any>req).auth || ""}${req.host}${req.path}`;
24+
const resp = await this.fetchFn(url, {
2225
method: opts.method || "GET",
2326
body: (<any>opts).body,
2427
headers: (opts.headers || {}) as { [key: string]: string },

0 commit comments

Comments
 (0)