You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MultiPartRepresentation.setBoundary drops the media type's other parameters #1600
MultiPartRepresentation.setBoundary(MediaType, String) drops the media type's other parameters when it already has a boundary parameter. It builds the new media type from the parent type only:
if (mediaType.getParameters().getFirst(PARAMETER_BOUNDARY) != null) {
result = newMediaType(mediaType.getParent(), PARAMETER_BOUNDARY, boundary);
}
So multipart/mixed; boundary=a; deferSpec=20220824 becomes multipart/mixed; boundary=b, and deferSpec is lost. The instance method setBoundary(String) has the same effect, since it delegates to the static one. When the media type has no boundary yet, the other parameters are kept, so the behavior depends on the input.
Why it matters
Some protocols carry other parameters on multipart types, such as deferSpec for GraphQL incremental delivery and type/start for multipart/related. The new streaming MultipartStreamRepresentation (#1587, #1595) keeps them.
Proposed direction
Replace only the boundary parameter and keep the others in their order. Add a test covering both cases, with and without an existing boundary.
Activity
fix: keep the other media type parameters in MultiPartRepresentation.…
fix: keep the other media type parameters in MultiPartRepresentation.…
fix: keep the other media type parameters in MultiPartRepresentation.…
jlouvel commentedon Nov 2, 2026
Fixed by #1606, merged into 3.0.