MCPcopy Index your code
hub / github.com/simstudioai/sim / readExecuteRequestBody

Function readExecuteRequestBody

apps/sim/app/api/workflows/[id]/execute/route.ts:148–161  ·  view source on GitHub ↗
(req: NextRequest)

Source from the content-addressed store, hash-verified

146}
147
148async function readExecuteRequestBody(req: NextRequest): Promise<unknown> {
149 assertContentLengthWithinLimit(
150 req.headers,
151 MAX_WORKFLOW_EXECUTE_BODY_BYTES,
152 'Workflow execution request body'
153 )
154 const buffer = await readStreamToBufferWithLimit(req.body, {
155 maxBytes: MAX_WORKFLOW_EXECUTE_BODY_BYTES,
156 label: 'Workflow execution request body',
157 signal: req.signal,
158 })
159 if (buffer.byteLength === 0) return {}
160 return JSON.parse(buffer.toString('utf-8'))
161}
162
163function clientCancelledResponse(): NextResponse {
164 return NextResponse.json({ success: false, error: 'Client cancelled request' }, { status: 499 })

Callers 1

handleExecutePostFunction · 0.85

Calls 4

parseMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected