Skip to content

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

Closed

Description

@spring-projects-issues

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

Activity

  1. spring-projects-issues commented on Sep 27, 2016

    @spring-projects-issues
    CollaboratorAuthor

    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.

  2. spring-projects-issues commented on Oct 26, 2016

    @spring-projects-issues
    CollaboratorAuthor

    Sébastien Deleuze commented

    Pull request submitted.

  3. spring-projects-issues commented on Nov 4, 2016

    @spring-projects-issues
    CollaboratorAuthor

    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.

  4. spring-projects-issues commented on Nov 8, 2016

    @spring-projects-issues
    CollaboratorAuthor

    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.

  5. added
    type: enhancement
    in: web
    on Jan 11, 2019
  6. added this to the 5.0 M3 milestone on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: webtype: enhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions