From cce14d7039ab59a0d81c1bd55f0a379a1e4e39b6 Mon Sep 17 00:00:00 2001 From: Kevin L'Hereec Date: Fri, 17 Jul 2026 16:19:50 +0200 Subject: [PATCH] fix: increase raw body limit to 4mb for CWMP XML payloads GetParameterNamesResponse from CPEs with many parameters exceeds the default 56kb raw body limit. Add a 'raw' section in bodyparser config covering text/xml, application/xml and application/soap+xml with a 4mb limit to handle large TR-069 discovery responses. --- config/bodyparser.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/config/bodyparser.ts b/config/bodyparser.ts index 7e836e6..9d8795c 100644 --- a/config/bodyparser.ts +++ b/config/bodyparser.ts @@ -73,6 +73,21 @@ const bodyParserConfig = defineConfig({ */ types: ['multipart/form-data'], }, + + /** + * Config for raw/text body parsing. + * CWMP/TR-069 uses text/xml. A GetParameterNamesResponse can easily + * exceed the default 56kb limit on devices with many parameters. + */ + raw: { + limit: '4mb', + types: [ + 'text/xml', + 'application/xml', + 'application/soap+xml', + 'text/plain', + ], + }, }) export default bodyParserConfig