Skip to content

Improve mimetype detection when serving a task output file - #660

Merged
julien-nc merged 2 commits into
mainfrom
fix/592/better-mimetype-detection-output-download
Sep 24, 2026
Merged

julien-nc merged 2 commits into
mainfrom
fix/592/better-mimetype-detection-output-download

Conversation

@julien-nc

Copy link
Copy Markdown
Member

We now deal with the file download just like when saving and generating a preview.

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI (N/A)

… like when saving and generating a preview)

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
@coderabbitai

coderabbitai Bot commented Sep 23, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: d042b18e-062b-46ad-acfb-c6ed283fc848

📥 Commits

Reviewing files that changed from the base of the PR and between fe8b945 and 66e2ad4.

📒 Files selected for processing (1)
  • lib/Controller/AssistantApiController.php

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

getOutputFile now detects the output file MIME type from its first 4096 bytes using finfo(FILEINFO_MIME_TYPE)->buffer(). The existing application/octet-stream fallback remains unchanged.

Merge Risk: ⚪ Minimal · up to 66e2a

The MIME detection change does not consume the downloaded content. No concrete merge-blocking risk is established; the PR is ready for normal checks.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description states that file download handling now matches the handling used for saving files and generating previews. This is related to the MIME type detection change.
Title check ✅ Passed The title clearly and concisely identifies the main change: improved MIME type detection when serving task output files.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files.
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.

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.

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
@julien-nc
julien-nc merged commit bc8bd36 into main Sep 24, 2026
14 of 15 checks passed
@julien-nc
julien-nc deleted the fix/592/better-mimetype-detection-output-download branch September 24, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants