Skip to content

"Content-Disposition" Header set in view_image function not matching RFC2183 rules #8914

@xieaoran

Description

@xieaoran

Custom Node Testing

Expected Behavior

When a file is fetched from ComfyUI via the view_image 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.

This will cause certain common functions (e.g. 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.

Image Image

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 in Golang), resulting in saving a file named "view" locally, which normally should be correctly named like "name.ext".

Debug Logs

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    BountyBugSomething is confirmed to not be working properly.Potential BugUser is reporting a bug. This should be tested.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions