From cc75b4067fdda2c628c31dde26832478f9612db1 Mon Sep 17 00:00:00 2001 From: Jan Kowalleck Date: Thu, 12 Jun 2025 13:00:31 +0200 Subject: [PATCH 1/2] fix: detected license file `*.rst` are of type text Signed-off-by: Jan Kowalleck --- cyclonedx_py/_internal/utils/mimetypes.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cyclonedx_py/_internal/utils/mimetypes.py b/cyclonedx_py/_internal/utils/mimetypes.py index 0d447c422..2eea3c8c0 100644 --- a/cyclonedx_py/_internal/utils/mimetypes.py +++ b/cyclonedx_py/_internal/utils/mimetypes.py @@ -22,19 +22,19 @@ _MIME_TEXT_PLAIN = 'text/plain' _MAP_EXT_MIME = { - # https://www.iana.org/assignments/media-types/media-types.xhtml + # https://www.iana.org/assignments/media-types/media-types.xhtml#text '.csv': 'text/csv', '.htm': 'text/html', '.html': 'text/html', '.md': 'text/markdown', '.txt': 'text/plain', '.rst': 'text/prs.fallenstein.rst', - '.rtf': 'application/rtf', + '.rtf': 'text/rtf', # not `application/rtf` -- our scope is text! '.xml': 'text/xml', # not `application/xml` -- our scope is text! + # add more mime types above this line. pull-requests welcome! # license-specific files '.license': _MIME_TEXT_PLAIN, '.licence': _MIME_TEXT_PLAIN, - # add more mime types. pull-requests welcome! } _LICENSE_FNAME_BASE = ('licence', 'license') From 24baf22305785389ec702289b350b483571472ad Mon Sep 17 00:00:00 2001 From: Jan Kowalleck Date: Thu, 12 Jun 2025 13:37:35 +0200 Subject: [PATCH 2/2] wip Signed-off-by: Jan Kowalleck --- cyclonedx_py/_internal/utils/mimetypes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cyclonedx_py/_internal/utils/mimetypes.py b/cyclonedx_py/_internal/utils/mimetypes.py index 2eea3c8c0..489ba008a 100644 --- a/cyclonedx_py/_internal/utils/mimetypes.py +++ b/cyclonedx_py/_internal/utils/mimetypes.py @@ -22,14 +22,14 @@ _MIME_TEXT_PLAIN = 'text/plain' _MAP_EXT_MIME = { - # https://www.iana.org/assignments/media-types/media-types.xhtml#text + # https://www.iana.org/assignments/media-types/media-types.xhtml '.csv': 'text/csv', '.htm': 'text/html', '.html': 'text/html', '.md': 'text/markdown', '.txt': 'text/plain', '.rst': 'text/prs.fallenstein.rst', - '.rtf': 'text/rtf', # not `application/rtf` -- our scope is text! + '.rtf': 'application/rtf', # our scope is text, yes, but RTF is binary - so we should base64 encode it ... '.xml': 'text/xml', # not `application/xml` -- our scope is text! # add more mime types above this line. pull-requests welcome! # license-specific files