-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Increase backend payload size limit to 2MB #1374
Conversation
WalkthroughThe changes modify the server configuration in Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
services/headless-lms/server/src/config.rs (1)
66-68
: Creation ofpayload_config
is correct and consistent.
Having a separatePayloadConfig
object for non-JSON request handling is a neat way to uniformly apply the 2 MB limit. If you want to keep the entire system consistent, ensure both JSON and generic payloads share the same environment-driven limit or constants in the future.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
services/headless-lms/server/src/config.rs
(5 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: build-and-deploy
- GitHub Check: build
- GitHub Check: headless_lms
🔇 Additional comments (6)
services/headless-lms/server/src/config.rs (6)
10-10
: Import changes look good.
AddingPayloadConfig
to the list of imports is consistent with the goal of configuring payload size limits for incoming requests.
55-55
: Confirm that the 2 MB JSON limit is sufficient and appropriate.
Raising the JSON payload limit to 2 MB can handle larger requests, which aligns with your PR objective. Ensure that your application’s performance and security needs (e.g., malicious large requests) are adequately addressed.
108-108
: Addition of thepayload_config
toServerConfig
is properly integrated.
This ensures you can pass the payload size limit around as a first-class config.
116-116
: Field addition inServerConfig
is straightforward.
Exposingpub payload_config: Data<PayloadConfig>
cleanly allows other parts of the code to reference this limit if needed.
140-140
: Destructuringpayload_config
in server config is valid.
This matches the pattern for other fields and sets you up to use the payload config in the Actix app.
146-146
: Registering.app_data(payload_config)
is aligned with Actix best practices.
This properly enforces the limit in all routes under the configured scope. Make sure to test large payload scenarios to confirm the 2 MB threshold is enforced as expected.
Summary by CodeRabbit