Skip to content

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

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

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

Conversation

@quantumnic
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
@isaac-mcfadyen
Copy link

This is a duplicate of #11377 and #11961

@comfy-pr-bot
Copy link
Member

Test Evidence Check

⚠️ Warning: Test Explanation Missing

If this PR modifies behavior that requires testing, a test explanation is required. PRs lacking applicable test explanations may not be reviewed until added. Please add test explanations to ensure code quality and prevent regressions.

⚠️ Warning: Visual Documentation Missing

If this PR changes user-facing behavior, visual proof (screen recording or screenshot) is required. PRs without applicable visual documentation may not be reviewed until provided.

You can add it by:

  • GitHub: Drag & drop media directly into the PR description
  • YouTube: Include a link to a short demo

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

3 participants