Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-13643

Content-Disposition with fixed file name "f.txt" causes confusion

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 4.1.8, 4.2.2
    • Fix Version/s: 3.2.16, 4.1.9, 4.2.3
    • Component/s: Web
    • Labels:
    • Last commented by a User:
      true

      Description

      $ curl -v localhost:8888/foo/bar/master/application.yml
      * Hostname was NOT found in DNS cache
      *   Trying 127.0.0.1...
      * Connected to localhost (127.0.0.1) port 8888 (#0)
      > GET /foo/bar/master/application.yml HTTP/1.1
      > User-Agent: curl/7.35.0
      > Host: localhost:8888
      > Accept: */*
      > 
      < HTTP/1.1 200 OK
      * Server Apache-Coyote/1.1 is not blacklisted
      < Server: Apache-Coyote/1.1
      < X-Application-Context: configserver:8888
      < Content-Disposition: attachment;filename=f.txt
      < Content-Type: text/plain;charset=UTF-8
      < Content-Length: 120
      < Date: Wed, 04 Nov 2015 14:48:09 GMT
      < 
      ...
      

      Users expect the filename would be "application.yml". It looks weird in the browser when you get a download of a file that has the wrong name.

      Here's the endpoint:

      @RequestMapping("/{name}/{profile}/{label}/{path:.*}")
      

      From https://github.com/spring-cloud/spring-cloud-config/blob/c0ddcd8/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/resource/ResourceController.java#L63

        Issue Links

          Activity

          Hide
          david_syer Dave Syer added a comment -

          I think we should support at least HAL media types (and any others provided by Spring Data REST). They might not be on the JAF list I guess.

          Show
          david_syer Dave Syer added a comment - I think we should support at least HAL media types (and any others provided by Spring Data REST). They might not be on the JAF list I guess.
          Hide
          rstoya05-aop Rossen Stoyanchev added a comment -

          Are they associated with any file extensions though?

          Show
          rstoya05-aop Rossen Stoyanchev added a comment - Are they associated with any file extensions though?
          Hide
          david_syer Dave Syer added a comment -

          > Are they associated with any file extensions though?

          I guess not.

          Show
          david_syer Dave Syer added a comment - > Are they associated with any file extensions though? I guess not.
          Hide
          rstoya05-aop Rossen Stoyanchev added a comment -

          RFC 6266 apparently defines two disposition types. The "inline" type doesn't enforce the Save As dialog so that should avoid the "f.txt" confusion more definitively.

          Show
          rstoya05-aop Rossen Stoyanchev added a comment - RFC 6266 apparently defines two disposition types. The "inline" type doesn't enforce the Save As dialog so that should avoid the "f.txt" confusion more definitively.
          Hide
          sdeleuze Sébastien Deleuze added a comment -

          Awesome

          Show
          sdeleuze Sébastien Deleuze added a comment - Awesome

            People

            • Assignee:
              rstoya05-aop Rossen Stoyanchev
              Reporter:
              david_syer Dave Syer
              Last updater:
              Stéphane Nicoll
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                2 years, 15 weeks, 2 days ago