Skip to content

fix: add disposition type to Content-Disposition header (RFC 2183)#12497

Open
redbasecap-buiss wants to merge 1 commit intoComfy-Org:masterfrom
redbasecap-buiss:fix/content-disposition-rfc2183
Open

fix: add disposition type to Content-Disposition header (RFC 2183)#12497
redbasecap-buiss wants to merge 1 commit intoComfy-Org:masterfrom
redbasecap-buiss:fix/content-disposition-rfc2183

Conversation

@redbasecap-buiss
Copy link

Summary

Fixes #8914

The Content-Disposition header in the /view endpoint was set to filename="name.ext" without a disposition type, violating RFC 2183.

This caused third-party HTTP clients (e.g. Go's mime.ParseMediaType) to fail parsing the filename from the header, leading to downloaded files being named view instead of the correct filename.

Changes

Added inline; disposition type prefix to all four Content-Disposition headers in server.py:

# Before
Content-Disposition: filename="image.png"

# After  
Content-Disposition: inline; filename="image.png"

inline is used (rather than attachment) to preserve the current browser behavior of displaying content directly rather than triggering a download dialog.

The Content-Disposition header was set to 'filename="name.ext"' without
a disposition type, violating RFC 2183. This caused third-party HTTP
clients (e.g. Go's mime.ParseMediaType) to fail parsing the filename.

Added 'inline;' disposition type prefix to all Content-Disposition headers
in the /view endpoint.

Fixes Comfy-Org#8914
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant