MCPcopy
hub / github.com/simstudioai/sim / assertParsedContentWithinLimit

Function assertParsedContentWithinLimit

apps/sim/app/api/files/parse/route.ts:414–419  ·  view source on GitHub ↗
(content: string, maxBytes?: number)

Source from the content-addressed store, hash-verified

412}
413
414function assertParsedContentWithinLimit(content: string, maxBytes?: number): string {
415 if (maxBytes !== undefined) {
416 assertKnownSizeWithinLimit(Buffer.byteLength(content, 'utf8'), maxBytes, 'parsed file output')
417 }
418 return content
419}
420
421/**
422 * Validate file path for security - prevents null byte injection and path traversal attacks.

Callers 5

handleLocalFileFunction · 0.85
handlePdfBufferFunction · 0.85
handleCsvBufferFunction · 0.85
handleGenericTextBufferFunction · 0.85
handleGenericBufferFunction · 0.85

Calls 1

Tested by

no test coverage detected