MCPcopy Create free account
hub / github.com/cloudflare/computer / send

Function send

packages/computerd/src/cli/computerd.ts:89–100  ·  view source on GitHub ↗
(
  response: ServerResponse,
  statusCode: number,
  body: string,
  headers: Record<string, string> = {},
)

Source from the content-addressed store, hash-verified

87}
88
89function send(
90 response: ServerResponse,
91 statusCode: number,
92 body: string,
93 headers: Record<string, string> = {},
94): void {
95 response.writeHead(statusCode, {
96 "content-length": Buffer.byteLength(body).toString(),
97 ...headers,
98 });
99 response.end(body);
100}
101
102function requestPath(request: IncomingMessage): string {
103 const url = new URL(request.url ?? "/", "http://localhost");

Callers 2

createHTTPServerFunction · 0.85
handleConnectFunction · 0.85

Calls 2

toStringMethod · 0.65
endMethod · 0.65

Tested by

no test coverage detected