fix: form data recursion#10726
Merged
jasonsaayman merged 9 commits intov1.xfrom Apr 15, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
3 issues found across 17 files
Confidence score: 4/5
- This PR looks generally safe to merge, with issues that are mostly localized and straightforward to fix rather than broad runtime regressions.
- The highest-impact item is in
tests/unit/toFormData.test.js:nest(100)appears to trigger the defaultmaxDepth: 100guard, so the boundary test is off by one and likely to fail unless adjusted. - There is a public API consistency gap in
lib/core/AxiosError.jsversus typings: the new runtime error code should also be declared inindex.d.tsto avoid TypeScript consumer mismatch. - Pay close attention to
tests/unit/toFormData.test.js,lib/core/AxiosError.js, anddocs/es/pages/advanced/multipart-form-data-format.md- boundary behavior, TS declaration parity, and docs option structure need alignment.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="docs/es/pages/advanced/multipart-form-data-format.md">
<violation number="1" location="docs/es/pages/advanced/multipart-form-data-format.md:86">
P3: Move `maxDepth` out of the `indexes` sublist so it renders as a top-level `formSerializer` option.</violation>
</file>
<file name="tests/unit/toFormData.test.js">
<violation number="1" location="tests/unit/toFormData.test.js:137">
P2: This boundary case is off by one: `nest(100)` already hits the default `maxDepth: 100` guard, so the test will fail. Use one level less for the success case (or expect an error).</violation>
</file>
<file name="lib/core/AxiosError.js">
<violation number="1" location="lib/core/AxiosError.js:89">
P2: Add the new error code to the TypeScript declaration; the runtime now exposes a public constant that `index.d.ts` does not declare.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Member
Author
|
@cubic-dev-ai please review again |
Contributor
@jasonsaayman I have started the AI code review. It will take a few minutes to complete. |
Contributor
There was a problem hiding this comment.
1 issue found across 19 files
Confidence score: 5/5
- Low merge risk: this is a single low-severity documentation issue (3/10) with no direct runtime or functional regression indicated.
- In
docs/es/pages/advanced/multipart-form-data-format.md, the example should use a multipart request; otherwiseformSerializeris ignored, which can mislead readers about correct usage. - Pay close attention to
docs/es/pages/advanced/multipart-form-data-format.md- ensure the request type matches multipart behavior so the example reflects actualformSerializerhandling.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="docs/es/pages/advanced/multipart-form-data-format.md">
<violation number="1" location="docs/es/pages/advanced/multipart-form-data-format.md:90">
P3: Use a multipart request here; otherwise `formSerializer` is ignored and the example is misleading.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
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.
Summary by cubic
Adds a recursion depth guard to FormData and query params serialization to prevent call-stack overflows. Defaults to
maxDepth: 100(configurable,Infinitydisables) and throwsAxiosErrorwith codeERR_FORM_DATA_DEPTH_EXCEEDED; docs, typings, and tests updated.Description
maxDepthtotoFormDataandAxiosURLSearchParams(default 100;Infinitydisables).AxiosErrorwithERR_FORM_DATA_DEPTH_EXCEEDEDwhen exceeded (instead ofRangeError).AxiosErrorat runtime and in typings (index.d.ts,index.d.cts).Docs
formSerializer.maxDepthandparamsSerializer.maxDepth, with examples and security notes.Testing
Infinitybehave as expected.AxiosURLSearchParamsenforcesmaxDepth.ERR_FORM_DATA_DEPTH_EXCEEDEDinindex.d.tsandindex.d.cts.Written for commit de52db8. Summary will update on new commits.