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
When passing name or filename containing non-ascii characters to the setContentDispositionFormData method, a browser like Chrome and IE may behave strangely, opening a download dialog where those characters are replaced by hyphens.
This is now fixed and backported.
This will be shortly available in the 5.0 and 4.3 SNAPSHOTS if you'd like to try it.
Note that I didn't change the default implementation of setContentDispositionFormData(String name, String filename), as the latest RFC7230 states that:
In practice, most HTTP header
field values use only a subset of the US-ASCII charset US-ASCII.
Newly defined header fields SHOULD limit their field values to
US-ASCII octets. A recipient SHOULD treat other octets in field
content (obs-text) as opaque data.
You can now use the dedicated method setContentDispositionFormData(String name, String filename, Charset charset), which requires the charset for the given field header.
The tests for this require consistent UTF-8 encoding in the test sources as well, following up on #16193 which switched enforced UTF-8 for the main sources.
Activity
spring-projects-issues commentedon Aug 25, 2016
Brian Clozel commented
This is now fixed and backported.
This will be shortly available in the 5.0 and 4.3 SNAPSHOTS if you'd like to try it.
Note that I didn't change the default implementation of
setContentDispositionFormData(String name, String filename), as the latest RFC7230 states that:You can now use the dedicated method
setContentDispositionFormData(String name, String filename, Charset charset), which requires the charset for the given field header.Let me know if you have any feedback about this.
Thanks for the report!
spring-projects-issues commentedon Aug 26, 2016
Juergen Hoeller commented
The tests for this require consistent UTF-8 encoding in the test sources as well, following up on #16193 which switched enforced UTF-8 for the main sources.