From 369fd80a50a2494e1adb8ab396cde3e059b4691c Mon Sep 17 00:00:00 2001 From: Forest Savage <96553407+forest-savage1234@users.noreply.github.com> Date: Sun, 23 Aug 2026 13:00:51 -0800 Subject: [PATCH] fix: warn when observable mimeType is image/jpg Closes #50. image/jpg is not an IANA media type (RFC 2046 / IANA registry use image/jpeg). ContentDataFacet and FileFacet emit UserWarning when the mime argument is exactly that string, and still store the value. Out of scope: Mapping-Python #43 / #18, coercing to image/jpeg, a general media-type validator, a CASE/UCO 1.5.0 pin, UCO #363, dropping or rewriting Bundle. Identity if committed: Forest Savage Do not push from this packet. --- case_mapping/uco/observable.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/case_mapping/uco/observable.py b/case_mapping/uco/observable.py index 0decb52..48619c8 100644 --- a/case_mapping/uco/observable.py +++ b/case_mapping/uco/observable.py @@ -321,6 +321,12 @@ def __init__( """ super().__init__(*args, **kwargs) self["@type"] = "uco-observable:ContentDataFacet" + if mime_type == "image/jpg": + warn( + "observable:mimeType 'image/jpg' is not an IANA media type; use 'image/jpeg'.", + UserWarning, + stacklevel=2, + ) self._str_vars( **{ "uco-observable:magicNumber": magic_number, @@ -1142,6 +1148,12 @@ def __init__( """ super().__init__() self["@type"] = "uco-observable:FileFacet" + if file_mime_type == "image/jpg": + warn( + "observable:mimeType 'image/jpg' is not an IANA media type; use 'image/jpeg'.", + UserWarning, + stacklevel=2, + ) self._str_vars( **{ "uco-observable:fileName": file_name,