Skip to content

Commit 69bf0ea

Browse files
committed
chore: try axios
1 parent bc38105 commit 69bf0ea

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

packages/consumption/src/modules/openid4vc/local/LocalAgentDependencies.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable no-console */
22
import { AgentDependencies } from "@credo-ts/core";
3+
import axios from "axios";
34
import { EventEmitter } from "events";
4-
import { fetch as undiciFetch } from "undici";
55
import webSocket from "ws";
66
import { EnmeshedHolderFileSystem } from "./EnmeshedHolderFileSystem";
77

@@ -15,11 +15,18 @@ export const agentDependencies: AgentDependencies = {
1515
console.log("############### agentDependencies-fetch-init #################", init);
1616

1717
try {
18-
const response = await undiciFetch(input as any, init as any);
18+
// const response = await undiciFetch(input as any, init as any);
19+
const response = await axios({
20+
method: init?.method ?? "GET",
21+
url: input.toString(),
22+
headers: init?.headers as Record<string, string> | undefined,
23+
data: init?.body
24+
});
1925

2026
console.log("############### agentDependencies-fetch-response #################", response);
2127

22-
return response;
28+
// return response;
29+
return new Response(response.data, { ...response } as ResponseInit);
2330
} catch (error) {
2431
console.error("############### agentDependencies-fetch-error #################", error);
2532
console.error("############### agentDependencies-fetch-error-stack #################", (error as any).stack);

0 commit comments

Comments
 (0)