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
Introduce HttpHeaders getContentDisposition() and setContentDisposition() [SPR-14408] #18979
The HTTP 1.1 spec defines the Content-Disposition header to contain a filename attribute that servers can use to indicate the name of the file served. Currently, users of HttpHeaders manually have to lookup the Content-Disposition header and then parse the value to extract the filename.
It would be cool if the filename was either available directly or HttpHeaders allowed to get access to a ContentDisposition object, that provides access to the filename contained in it.
Sébastien Deleuze I'm assigning this to you since Content-Disposition also comes up in multipart requests and you already have #19114 as well as #19108 for the reactive alternative of FormHttpMessageConverter. Note that HttpHeaders already has methods for setting the Content-Disposition header that are used by the form message converter when writing the headers for individual parts.
I have updated the PR that now introduces a new HttpHeaders.ContentDisposition class and a new HttpHeaders#getContentDisposition() method that allows to retrieve the disposition type and name, filename, filename* and size parameters.
It introduces a new ContentDisposition class designed to parse and generate Content-Disposition header value as defined in RFC 2183. It supports the disposition type and the name, filename (or filename* when encoded according to RFC 5987) and size parameters.
This new class is usually used thanks to the new getContentDisposition() and setContentDisposition(ContentDisposition) added to HttpHeaders.
Activity
spring-projects-issues commentedon Sep 27, 2016
Rossen Stoyanchev commented
Sébastien Deleuze I'm assigning this to you since
Content-Dispositionalso comes up in multipart requests and you already have #19114 as well as #19108 for the reactive alternative ofFormHttpMessageConverter. Note thatHttpHeadersalready has methods for setting theContent-Dispositionheader that are used by the form message converter when writing the headers for individual parts.spring-projects-issues commentedon Oct 26, 2016
Sébastien Deleuze commented
Pull request submitted.
spring-projects-issues commentedon Nov 4, 2016
Sébastien Deleuze commented
I have updated the PR that now introduces a new
HttpHeaders.ContentDispositionclass and a newHttpHeaders#getContentDisposition()method that allows to retrieve the disposition type andname,filename,filename*andsizeparameters.spring-projects-issues commentedon Nov 8, 2016
Sébastien Deleuze commented
I have resolved this issue via this commit.
It introduces a new
ContentDispositionclass designed to parse and generateContent-Dispositionheader value as defined in RFC 2183. It supports the disposition type and thename,filename(orfilename*when encoded according to RFC 5987) andsizeparameters.This new class is usually used thanks to the new
getContentDisposition()andsetContentDisposition(ContentDisposition)added toHttpHeaders.