Skip to content

feat: Add mimetype detection for rich text format (rtf) - #886

Merged
jkowalleck merged 3 commits into
CycloneDX:mainfrom
schlenk:mimetypertf
Apr 24, 2025
Merged

jkowalleck merged 3 commits into
CycloneDX:mainfrom
schlenk:mimetypertf

Conversation

@schlenk

@schlenk schlenk commented Apr 24, 2025

Copy link
Copy Markdown
Contributor

Add a mimetype for the Rich Text Format (RTF).

The format is 7-Bit ASCII safe, so automatically passes basic checks for UTF-8. But with all its custom tags and escape sequences it formally is closer to a binary format.

So we use the application/rtf mimetype instead of the also possible text/rtf mimetype, as most consumers will consider this to be binary.

This overrides the misdetection by the stdlib, which claims RTF to be associated with application/msword.

Signed-off-by: Michael Schlenker <michael.schlenker@contact-software.com>
@schlenk
schlenk requested a review from a team as a code owner April 24, 2025 15:01
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
@jkowalleck jkowalleck added the enhancement New feature or request label Apr 24, 2025
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
@jkowalleck
jkowalleck merged commit 9861a46 into CycloneDX:main Apr 24, 2025
@jkowalleck

Copy link
Copy Markdown
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants