• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stacklok / toolhive / 20960284882

13 Jan 2026 02:25PM UTC coverage: 58.034% (+0.04%) from 57.997%
20960284882

push

github

web-flow
Add request body size limit middleware function (#3114)

* Add request body size limit middleware function
Implement middleware func in pkg/api/server.go to enforce 1MB request body size limit
Requests exceeding this limit receive HTTP 413 response
Added comprehensive tests for boundary conditions
fixes #3054

Signed-off-by: muzman123 <muzammilmuhammad12@gmail.com>

* fix: added test for MaxBytesReader safety net behaviour,
edited requestBodySizeLimitMiddleware to send JSON formatted error instead of plain text,
ran task lint-fix on new/edited files

* fix: remove content-type logic, add diagnostic log, wrap MaxBytesReader with a 413 wrapper

* fix linting issues

---------

Signed-off-by: muzman123 <muzammilmuhammad12@gmail.com>
Co-authored-by: Don Browne <don@stacklok.com>
Co-authored-by: Don Browne <dmjb@users.noreply.github.com>

30 of 33 new or added lines in 1 file covered. (90.91%)

6 existing lines in 3 files now uncovered.

34374 of 59231 relevant lines covered (58.03%)

80.58 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

9.74
/pkg/api/server.go


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc