"Content-Disposition" Header set in view_image function not matching RFC2183 rules
- Dominant language
- Python
- Stars
- 133k
- Forks
- 15.7k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 158
Description
### Custom Node Testing
- [x] I have tried disabling custom nodes and the issue persists (see [how to disable custom nodes](https://docs.comfy.org/troubleshooting/custom-node-issues#step-1%3A-test-with-all-custom-nodes-disabled) if you need help)
### Expected Behavior
When a file is fetched from ComfyUI via the [view_image](https://github.com/comfyanonymous/ComfyUI/blob/master/server.py#L421) function, the "Content-Disposition" response header will be set to something like `filename=name.ext`, which doesn't match with the definition of this specific header in [RFC 2183](https://www.rfc-editor.org/rfc/rfc2183.html).
This will cause certain common functions (e.g. [mime.ParseMediaType](https://pkg.go.dev/mime#ParseMediaType) in Golang) to produce an error instead of parsing out the filename successfully, thus preventing various third party downloading libraries from extracting the correct filename, leading to unexpected behavior in certain post-Comfy processing procedures.
Expected Behavior should be setting the "Content-Disposition" response header as specified in RFC 2183, which should be something like `attachment; filename=name.ext`.
### Actual Behavior
"Content-Disposition" response header set to something like `filename=name.ext`.
### Steps to Reproduce
Attempt downloading a file from "/view" URL route via various third party downloading libraries (e.g. [grab](https://github.com/cavaliergopher/grab) in Golang), resulting in saving a file named "view" locally, which normally should be correctly named like "name.ext".
### Debug Logs
```powershell
HTTP/1.1 200 OK
Content-Disposition: filename="vace14b_00003.mp4"
Content-Type: video/mp4
Etag: "18521d76691232cf-3102a6e"
Last-Modified: Mon, 14 Jul 2025 12:20:00 GMT
Content-Length: 51391086
Accept-Ranges: bytes
Date: Tue, 15 Jul 2025 03:51:51 GMT
connection: keep-alive
```
### Other
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.