Skip to content

fix: attachments < 512 bytes caused mime type detection failed - #15

Merged
junghao merged 2 commits into
masterfrom
mimetype-fix
Sep 1, 2026
Merged

fix: attachments < 512 bytes caused mime type detection failed#15
junghao merged 2 commits into
masterfrom
mimetype-fix

Conversation

@junghao

@junghao junghao commented Sep 1, 2026

Copy link
Copy Markdown

As title.
The existing code assumes the attachments will have size > 512 bytes.
Thus a small txt file resulted in lots of null bytes, being identified by Go's standard library as binary file due to null value not allowed in text files.

@junghao
junghao requested review from bpeng and removed request for bpeng September 1, 2026 03:04

@bpeng bpeng left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks good

@junghao
junghao merged commit 0be54fd into master Sep 1, 2026
6 checks passed
@junghao
junghao deleted the mimetype-fix branch September 1, 2026 03:53
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.

2 participants