chore: replace deprecated body-parser with express built-in middleware#38235
Conversation
|
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
WalkthroughThis change removes the body-parser dependency from the router and replaces it with Express's built-in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
75e38c4 to
4f050fe
Compare
|
Hi maintainers , The CLA issue has been resolved and all automated checks are now passing. Could someone please review and add the Thanks for your time! |
4f050fe to
2d4b0c5
Compare
Proposed changes
This PR removes the deprecated body-parser middleware usage and replaces it with Express built-in middleware (express.json() and express.urlencoded()).
Express has provided native body parsing since v4.16, so this change:
Eliminates deprecation warnings
Removes an unnecessary dependency
Preserves existing behavior (extended: false)
No functional or API behavior changes are introduced.
🧩 Issue(s)
N/A — maintenance / deprecation cleanup
(No existing issue required)
🧪 Steps to test or reproduce
Start Rocket.Chat locally:
yarn dsv
Verify server starts without body-parser deprecation warnings
Confirm Apps API routes still work:
/api/apps/private/:appId/:hash
/api/apps/public/:appId
💬 Further comments
This change intentionally avoids any behavioural changes and strictly replaces deprecated middleware with Express-native alternatives. The default extended: false option is preserved to match previous behaviour.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.