Skip to content

Content-Disposition with fixed file name "f.txt" causes confusion [SPR-13643] #18220

Closed
@spring-projects-issues

Description

@spring-projects-issues

Dave Syer opened SPR-13643 and commented

$ 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


Affects: 4.1.8, 4.2.2

Issue Links:

Referenced from: commits a3168fd, 92ca537, 1489e29, 3a919a4, f0464e8, f5f57e9, 71a9eb7

Backported to: 4.1.9, 3.2.16

0 votes, 7 watchers

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)status: backportedAn issue that has been backported to maintenance branchestype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions