Skip to content

Duplicate Content-Disposition Header on File Download #49

@wienczny

Description

@wienczny

When trying to download an attached file I get an error about duplicate Content-Disposition headers. Using curl I get this:

curl -v http://localhost:8025/api/v1/messages/[email protected]/mime/part/2/download -o /tmp/test.pdf
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying ::1...
* Connected to localhost (::1) port 8025 (#0)
> GET /api/v1/messages/[email protected]/mime/part/2/download HTTP/1.1
> Host: localhost:8025
> User-Agent: curl/7.42.0
> Accept: */*
> 
< HTTP/1.1 200 OK
< Content-Disposition: attachment; filename="y7BMbIFKdxn05pFmZRKNKd74z6QgScJdnKYyndNcCFQ=@mailhog.example-part-2"
< Content-Disposition: inline; filename="picklist_145000114.pdf"
< Content-Transfer-Encoding: base64
< Content-Type: application/pdf
< Date: Thu, 30 Apr 2015 13:39:23 GMT
< Transfer-Encoding: chunked
< 
{ [16057 bytes data]
100 1509k    0 1509k    0     0  20.9M      0 --:--:-- --:--:-- --:--:-- 21.0M
* Connection #0 to host localhost left intact

The returned file seems to be correct, but browsers like Chrome and Firefox don't accept it because the headers are broken ;-(

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions