Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix FormData clone boundary inconsistency issue (#2305)
Resolves #2303 ## Fix boundary inconsistency in FormData.clone method Description: This PR addresses an issue where cloning FormData objects resulted in different boundaries each time. The problem was caused by allocating a new boundary for each clone without any boundary reuse logic. Changes made: - Added an `initBoundary` parameter to the FormData constructor. - Implemented boundary reuse logic when cloning FormData objects. - Updated documentation to explain how `initBoundary` affects `boundaryName`. Technical details: - The `FormData` constructor now accepts an optional `initBoundary` parameter. - When `initBoundary` is provided, it overrides the `boundaryName` configuration. - The cloning process now reuses the existing boundary when appropriate. Impact: This fix ensures consistent behavior when cloning FormData objects and improves efficiency by reusing boundaries where possible. It should resolve issues related to unexpected boundary changes during FormData manipulation. Testing: - Added unit tests to verify boundary consistency across cloned FormData objects. - Manually tested with various use cases to ensure backward compatibility.
- Loading branch information