// Synthetic reproduction of the mcp-framework <0.2.22 HTTP-body bug.
// Body is accumulated into a string with no Content-Length guard.
// Do not copy — this exists only to exercise AAK-MCPFRAME-001.

import type { IncomingMessage } from "http";

export async function readRequestBody(req: IncomingMessage): Promise<string> {
  let body = "";
  for await (const chunk of req) {
    body += chunk.toString("utf-8");
  }
  return body;
}
