Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 24, 2025

Conversation

schlenk
Copy link
Contributor

@schlenk schlenk commented Apr 24, 2025

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
2 of 3 checks passed
@jkowalleck
Copy link
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