From a06c96e871da7e19873587a386bdc2704b747023 Mon Sep 17 00:00:00 2001 From: Michael Schlenker Date: Thu, 24 Apr 2025 16:55:58 +0200 Subject: [PATCH 1/3] feat: Add mimetype detection for rich text format (rtf) Signed-off-by: Michael Schlenker --- cyclonedx_py/_internal/utils/mimetypes.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cyclonedx_py/_internal/utils/mimetypes.py b/cyclonedx_py/_internal/utils/mimetypes.py index 6ac49b08..2dd51a9e 100644 --- a/cyclonedx_py/_internal/utils/mimetypes.py +++ b/cyclonedx_py/_internal/utils/mimetypes.py @@ -34,6 +34,7 @@ '.license': _MIME_TEXT_PLAIN, '.licence': _MIME_TEXT_PLAIN, # add more mime types. pull-requests welcome! + '.rtf': 'application/rtf', # `text/rtf` could be used, but application fits better } _LICENSE_FNAME_BASE = ('licence', 'license') From a38b736a8c799afbedf35f095f4f3e54158bb072 Mon Sep 17 00:00:00 2001 From: Jan Kowalleck Date: Thu, 24 Apr 2025 17:04:54 +0200 Subject: [PATCH 2/3] Update cyclonedx_py/_internal/utils/mimetypes.py Signed-off-by: Jan Kowalleck --- cyclonedx_py/_internal/utils/mimetypes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cyclonedx_py/_internal/utils/mimetypes.py b/cyclonedx_py/_internal/utils/mimetypes.py index 2dd51a9e..9d408989 100644 --- a/cyclonedx_py/_internal/utils/mimetypes.py +++ b/cyclonedx_py/_internal/utils/mimetypes.py @@ -34,7 +34,7 @@ '.license': _MIME_TEXT_PLAIN, '.licence': _MIME_TEXT_PLAIN, # add more mime types. pull-requests welcome! - '.rtf': 'application/rtf', # `text/rtf` could be used, but application fits better + '.rtf': 'application/rtf', } _LICENSE_FNAME_BASE = ('licence', 'license') From 66135a8a0cd85ed97cba3c26fd9c846ecef5c2d3 Mon Sep 17 00:00:00 2001 From: Jan Kowalleck Date: Thu, 24 Apr 2025 17:08:09 +0200 Subject: [PATCH 3/3] Update mimetypes.py Signed-off-by: Jan Kowalleck --- cyclonedx_py/_internal/utils/mimetypes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cyclonedx_py/_internal/utils/mimetypes.py b/cyclonedx_py/_internal/utils/mimetypes.py index 9d408989..0d447c42 100644 --- a/cyclonedx_py/_internal/utils/mimetypes.py +++ b/cyclonedx_py/_internal/utils/mimetypes.py @@ -29,12 +29,12 @@ '.md': 'text/markdown', '.txt': 'text/plain', '.rst': 'text/prs.fallenstein.rst', + '.rtf': 'application/rtf', '.xml': 'text/xml', # not `application/xml` -- our scope is text! # license-specific files '.license': _MIME_TEXT_PLAIN, '.licence': _MIME_TEXT_PLAIN, # add more mime types. pull-requests welcome! - '.rtf': 'application/rtf', } _LICENSE_FNAME_BASE = ('licence', 'license')