MCPcopy
hub / github.com/CapSoftware/Cap / readRequestBody

Function readRequestBody

apps/chrome-extension/e2e/webcam-start.spec.ts:42–48  ·  view source on GitHub ↗
(request: IncomingMessage)

Source from the content-addressed store, hash-verified

40const BOOTSTRAP_CACHE_KEY = "cap-extension-bootstrap-cache";
41
42const readRequestBody = async (request: IncomingMessage) => {
43 const chunks: Buffer[] = [];
44 for await (const chunk of request) {
45 chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
46 }
47 return Buffer.concat(chunks);
48};
49
50const sendJson = (
51 response: ServerResponse,

Callers 1

createMockCapServerFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected