MCPcopy Create free account
hub / github.com/OpenHands/OpenHands / getText

Function getText

__tests__/scripts/static-server.test.ts:99–117  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

97 }
98
99 async function getText(url: string) {
100 return new Promise<{ status: number; body: string }>((resolve, reject) => {
101 const req = request(url, { method: "GET" }, (res) => {
102 let body = "";
103 res.setEncoding("utf8");
104 res.on("data", (chunk) => {
105 body += chunk;
106 });
107 res.on("end", () => {
108 resolve({
109 status: res.statusCode ?? 0,
110 body,
111 });
112 });
113 });
114 req.on("error", reject);
115 req.end();
116 });
117 }
118
119 describe("parseArgs", () => {
120 it("defaults host to IPv4 loopback", () => {

Callers 1

Calls 2

resolveFunction · 0.70
requestFunction · 0.50

Tested by

no test coverage detected