chore: Add test coverage for multipart BodyLimit error handling#4237
Draft
chore: Add test coverage for multipart BodyLimit error handling#4237
Conversation
3 tasks
Agent-Logs-Url: https://github.com/gofiber/fiber/sessions/40fc5de4-74d2-411b-885d-f6fd77d25222 Co-authored-by: gaby <[email protected]>
Copilot
AI
changed the title
[WIP] Fix error handling for multipart forms exceeding BodyLimit
🐛 bug: cover multipart BodyLimit error handling with a regression test
Apr 25, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4237 +/- ##
=======================================
Coverage 91.17% 91.17%
=======================================
Files 123 123
Lines 12084 12084
=======================================
Hits 11018 11018
Misses 668 668
Partials 398 398
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Oversized multipart uploads were reported as bypassing custom
ErrorHandlerresponses and surfacing as a generic client-side network error instead of a413response. This PR adds regression coverage for that path so multipart requests exceedingBodyLimitare verified to return the same custom error response shape as other oversized requests.What changed
multipart/form-datarequests handled through a customErrorHandler413 Request Entity Too LargeRegression coverage
*fiber.Errorand serialized by the app’s custom error handler, rather than failing as a transport-level"error"on the clientExample
Changes introduced
List the new features or adjustments introduced in this pull request. Provide details on benchmarks, documentation updates, changelog entries, and if applicable, the migration guide.
Type of change
Please delete options that are not relevant.
Checklist
Before you submit your pull request, please make sure you meet these requirements:
/docs/directory for Fiber's documentation.Commit formatting
Please use emojis in commit messages for an easy way to identify the purpose or intention of a commit. Check out the emoji cheatsheet here: CONTRIBUTING.md