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

        Attachments

          Issue Links

            Activity

              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:
                  3 years, 1 week, 6 days ago