feat: add body size limit config as env var

This commit is contained in:
Kilian Decaderincourt
2021-12-01 17:16:54 +01:00
parent 77479b8a5d
commit 2e433c3233
2 changed files with 6 additions and 5 deletions

View File

@ -4,7 +4,10 @@ import { hasBody } from 'type-is';
// Excalidraw Front end doesn't send a Content Type Header
// so we tell raw parser to check if there is a body
const rawParserMiddleware = raw({ type: hasBody });
const rawParserMiddleware = raw({
type: hasBody,
limit: process.env.BODY_LIMIT ?? '50mb',
});
@Injectable()
export class RawParserMiddleware implements NestMiddleware {