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

Introduce HttpHeaders getContentDisposition() and setContentDisposition() [SPR-14408] #18979

Closed
spring-projects-issues opened this issue Jun 27, 2016 · 4 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Jun 27, 2016

Oliver Drotbohm opened SPR-14408 and commented

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.


Affects: 4.3 GA

Issue Links:

Referenced from: commits 99a8510

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Sep 27, 2016

Rossen Stoyanchev commented

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.

@spring-projects-issues
Copy link
Collaborator Author

Sébastien Deleuze commented

Pull request submitted.

@spring-projects-issues
Copy link
Collaborator Author

Sébastien Deleuze commented

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.

@spring-projects-issues
Copy link
Collaborator Author

Sébastien Deleuze commented

I have resolved this issue via this commit.

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.

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

2 participants