feature: added request body size limiting middleware#2598
feature: added request body size limiting middleware#2598Jeet-Srivastava wants to merge 4 commits intogofr-dev:developmentfrom
Conversation
- Add BodySizeLimit middleware to prevent DoS attacks from large request bodies - Configurable via HTTP_MAX_BODY_SIZE environment variable (default: 10 MB) - Returns HTTP 413 when request body exceeds limit - Comprehensive test coverage including unit and integration tests - Follows GoFr middleware patterns and coding standards
|
@Jeet-Srivastava which issue ticket is this related to? |
|
Hi @aryanmehrotra
|
@Jeet-Srivastava Thankyou for your contribution to GoFr and taking an effort to make this PR. I would request you to please also create an issue describing how GoFr is prone to DoS from large request bodies, and then i think you can link this PR in that issue that will make perfect sense. Secondly i would also request you to kindly resolve the code quality issues and the failing tests for the PR so that it is review ready. Please let us know if you need any assistance. Thankyou. |
- Remove exemption for GET, HEAD, DELETE methods to prevent DoS - Update tests to verify limits on all methods
|
This PR is raised agains the issue #2607 |

Description:
Breaking Changes (if applicable):
Additional Information:
Checklist:
goimportandgolangci-lint.