Skip to content

Fix Content-Disposition header missing attachment prefix#13093

Merged
guill merged 2 commits into
Comfy-Org:masterfrom
themachinehf:fix/content-disposition-header
May 5, 2026
Merged

Fix Content-Disposition header missing attachment prefix#13093
guill merged 2 commits into
Comfy-Org:masterfrom
themachinehf:fix/content-disposition-header

Conversation

@themachinehf
Copy link
Copy Markdown
Contributor

Adds missing attachment directive to Content-Disposition headers in server.py to ensure browsers properly download files instead of attempting to display them inline. Fixes 4 instances in the file download endpoint.

Add missing 'attachment;' directive to Content-Disposition headers in
server.py to ensure browsers properly download files instead of
attempting to display them inline.

Fixes 4 instances in the file download endpoint.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 21, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f880b032-0d60-4a92-a817-e4613ebec66e

📥 Commits

Reviewing files that changed from the base of the PR and between 43d8f56 and 16d0da5.

📒 Files selected for processing (1)
  • server.py

📝 Walkthrough

Walkthrough

The change updates the Content-Disposition header in the view_image endpoint of server.py from filename="..." to attachment; filename="..." across all image-serving branches: preview (webp/jpeg), PNG outputs for channel=rgb and channel=a, and the fallback web.FileResponse. This makes the image responses explicitly served as downloadable attachments.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and accurately describes the main change: adding the 'attachment' prefix to Content-Disposition headers to fix file download behavior.
Description check ✅ Passed The description is clearly related to the changeset, explaining the purpose of adding the 'attachment;' directive to Content-Disposition headers and noting it fixes four instances.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Member

@guill guill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, will merge once CI clears.

@guill guill merged commit ea6880b into Comfy-Org:master May 5, 2026
14 checks passed
@without-ordinary
Copy link
Copy Markdown

So now Open Image (ie. the context menu option to open the image in a new tab) does functionally the same thing as Save Image (trigger the browser to save the image) but with the added quirk that is briefly opens a new tab?

@silveroxides
Copy link
Copy Markdown
Contributor

@guill @themachinehf
This breaks functionality which is still used by many (Open Image in context menu allowing user to open image in new tab) and it creates a state where there exist two context menu options performing same action (Now Open Image forcibly downloads image while Save image also does this..

Following is video from before this commit demonstrating the use of both these context menu options:

msedge_nTWAlDXICv.mp4

Below is video demonstrating the now abritrary changes in place and the two options performing essentially the same thing.

msedge_6OmiLaPMf3.mp4

I also made a comment on the actual commit here which lays out why this is bad change and suggest that if this is for the cloud then cut a branch for cloud instead: ea6880b#commitcomment-184423832

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.

4 participants