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

Function csvProxyBodyCapResponse

apps/sim/app/api/table/utils.ts:99–111  ·  view source on GitHub ↗
(request: { headers: Headers })

Source from the content-addressed store, hash-verified

97
98/** 413 response when a synchronous CSV upload would exceed (and be truncated at) the proxy cap; `null` otherwise. */
99export function csvProxyBodyCapResponse(request: { headers: Headers }): NextResponse | null {
100 const contentLength = Number(request.headers.get('content-length') ?? 0)
101 if (contentLength > CSV_IMPORT_PROXY_BODY_CAP_BYTES) {
102 return NextResponse.json(
103 {
104 error:
105 'File too large to import through the server. Files over 10MB import in the background.',
106 },
107 { status: 413 }
108 )
109 }
110 return null
111}
112
113/** Maps a {@link MultipartError} from the streaming CSV parser to its HTTP response. */
114export function multipartErrorResponse(error: MultipartError): NextResponse {

Callers 2

route.tsFile · 0.90
route.tsFile · 0.90

Calls 1

getMethod · 0.65

Tested by

no test coverage detected