Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FormHttpMessageConverter should not have a dependency on the Jakarta Mail API #28392

Closed
jomastel opened this issue Apr 28, 2022 · 1 comment
Closed
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@jomastel
Copy link

When working with multipartCharset the FormHttpMessageConverter uses the MimeUtility.encodeText method.
This forces a dependency for sending email inside a HTTP converter.
In our case, we now need to import org.springframework.boot:spring-boot-starter-mail to fix this dependency.

Could an alternative import be used here to avoid such dependencies in the case of Content-Type multipart?
We found this issue when using a simple REST API.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Apr 28, 2022
@poutsma poutsma added in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement labels Apr 28, 2022
@poutsma poutsma added this to the 6.0.0-M4 milestone Apr 28, 2022
@poutsma poutsma removed the status: waiting-for-triage An issue we've not yet triaged or decided on label Apr 28, 2022
@poutsma
Copy link
Contributor

poutsma commented Apr 28, 2022

The dependency to MimeUtility was introduced in 2014. In 2016, we introduced the Content-Disposition type, with its own MIME encoding logic in encodeFilename.

I will drop the call to MimeUtility.encodeText in favor of the mechanism in Content-Disposition as of 6.0 M4. This means that we will move from using RFC 2047 to RFC 5987 for filename parameters, as we already do in Spring WebFlux' multipart support.

@poutsma poutsma self-assigned this Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants