MCPcopy Create free account
hub / github.com/EvoMap/evolver / readBody

Function readBody

test/proxyEnvelope.test.js:108–117  ·  view source on GitHub ↗
(req)

Source from the content-addressed store, hash-verified

106}
107
108function readBody(req) {
109 return new Promise((resolve) => {
110 const chunks = [];
111 req.on('data', (c) => chunks.push(c));
112 req.on('end', () => {
113 try { resolve(JSON.parse(Buffer.concat(chunks).toString() || '{}')); }
114 catch { resolve({}); }
115 });
116 });
117}
118
119describe('proxy /asset/* -> hub envelope wrapping (e2e)', () => {
120 let hub, hubUrl, proxy, proxyUrl, dataDir;

Callers 1

Calls 1

parseMethod · 0.80

Tested by

no test coverage detected