Skip to content

[16.0][FIX] fs_attachment: don't crash on fs streams without mimetype - #710

Draft
lmignon wants to merge 1 commit into
OCA:16.0from
acsone:16.0-fix-fs_attachment-stream-no-mimetype
Draft

lmignon wants to merge 1 commit into
OCA:16.0from
acsone:16.0-fix-fs_attachment-stream-no-mimetype

Conversation

@lmignon

@lmignon lmignon commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

For "fs" streams, the mimetype is taken as is from the attachment and may be empty for attachments written outside the ORM. Since #584, ir.binary._get_stream_from then called guess_extension(False), and FsStream.get_response passed mimetype=False to werkzeug: both raised an AttributeError and the download returned a 500.

Fall back to default_mimetype for fs streams with no mimetype, as core does for "data" and "path" streams, and only run the extension guess for fs streams, since core already does it for the other stream types.

Fixes #684

Backport of #685

  • TO BE investigated: test failing

For "fs" streams, the mimetype is taken as is from the attachment and may
be empty for attachments written outside the ORM. Since OCA#584,
ir.binary._get_stream_from then called guess_extension(False), and
FsStream.get_response passed mimetype=False to werkzeug: both raised an
AttributeError and the download returned a 500.

Fall back to default_mimetype for fs streams with no mimetype, as core
does for "data" and "path" streams, and only run the extension guess for
fs streams, since core already does it for the other stream types.

Fixes OCA#684
@lmignon lmignon changed the title [FIX] fs_attachment: don't crash on fs streams without mimetype [16.0][FIX] fs_attachment: don't crash on fs streams without mimetype Dec 4, 2026
@lmignon
lmignon marked this pull request as draft December 4, 2026 09:23
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