Priority: Medium
Category: Bug
Files: server/index.js:98
Description
The Express JSON body parser is configured with a 10KB limit:
app.use(express.json({ limit: "10kb" }));
This applies globally to ALL endpoints. Several operations could exceed 10KB:
- Profile updates with multiple addresses, each with multiple fields
- Bug reports containing long descriptions and data URLs
- Bulk product operations
- Order creation with many items
When the limit is exceeded, Express returns a 413 Payload Too Large error without any custom error handling.
Impact
- Users with multiple addresses may fail to save their profile
- Bug reports with detailed descriptions may be rejected
- Poor error messaging — Express returns a raw
413 without the app's error format
Recommendation
- Increase the limit to a reasonable value (e.g.,
1mb or 5mb)
- Add error handling middleware for
SyntaxError and PayloadTooLargeError to return user-friendly messages
- Consider using different limits for different route groups if needed
Priority: Medium
Category: Bug
Files:
server/index.js:98Description
The Express JSON body parser is configured with a 10KB limit:
This applies globally to ALL endpoints. Several operations could exceed 10KB:
When the limit is exceeded, Express returns a 413 Payload Too Large error without any custom error handling.
Impact
413without the app's error formatRecommendation
1mbor5mb)SyntaxErrorandPayloadTooLargeErrorto return user-friendly messages