spring-projects / spring-projects/spring-framework

Support "multipart/mixed" and "multipart/related"

Open
#30,230 2 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

in: web type: enhancement
Dominant language
Java
Stars
60.2k
Forks
38.8k
Avg merge
5d 2h
Merged PRs (30d)
27

Description

Besides multipart/form-data, there are two other multipart media types in use:

These have different properties than multipart/form-data, for instance in that they do not require a Content-Dispostion header for each part.

Furthermore, it seems that OData relies on nested multipart/mixed structures, where the outer batch part can contain a changeset that is in itself a multipart consisting of changes.

Not having done a full investigation, it appears that there are a number of issues with our current WebFlux multipart support that prevents us from fully supporting multipart/mixed and multipart/related:

  • The DefaultPartHttpMessageReader is not capable of reading nested multipart messages.
  • The MultipartHttpMessageWriter and PartEventHttpMessageWriter are not capable of writing nested multipart messages, except in a raw form.
  • The Part and PartEvent interfaces expose a name property that reflects the Content-Disposition name, but which only makes sense in multipart/form-data.
  • The MultipartHttpMessageWriter and PartEventHttpMessageWriter write a Content-Disposition header, which it only needed in multipart/form-data.

This issue was created to gather all research done on multipart/mixed and multipart/related done so far, and to see how much interest there is in the community for Spring Framework to fully support these multipart types.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing DefaultPartHttpMessageReader, MultipartHttpMessageWriter, PartEventHttpMessageWriter, Part, and PartEvent, then compare their current behavior with RFC 1341, RFC 2387, and the linked OData and Google Cloud multipart examples. Document the required reader and writer changes for nested multipart/mixed and multipart/related support and define acceptance criteria before implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.