From 4c7e6f990a1a3f3012f43c1b2ac47fc25f9ad027 Mon Sep 17 00:00:00 2001 From: Sean Whalen Date: Sat, 2 Nov 2024 12:37:31 -0400 Subject: [PATCH] 5.7.8 - Move SVG validation errors from `["bimi"]["warnings"]` to `["bimi"]["image"]["validation_errors"]` (#150) --- CHANGELOG.md | 5 +++++ checkdmarc/_constants.py | 2 +- checkdmarc/bimi.py | 8 +++++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 096481b..abec3a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ Changelog ========= +5.7.8 +----- + +- Move SVG validation errors from `["bimi"]["warnings"]` to `["bimi"]["image"]["validation_errors"]` (#150) + 5.7.7 ----- diff --git a/checkdmarc/_constants.py b/checkdmarc/_constants.py index 05f51cf..d91b201 100644 --- a/checkdmarc/_constants.py +++ b/checkdmarc/_constants.py @@ -18,7 +18,7 @@ See the License for the specific language governing permissions and limitations under the License.""" -__version__ = "5.7.7" +__version__ = "5.7.8" OS = platform.system() OS_RELEASE = platform.release() diff --git a/checkdmarc/bimi.py b/checkdmarc/bimi.py index 923fa04..9a0b137 100644 --- a/checkdmarc/bimi.py +++ b/checkdmarc/bimi.py @@ -567,13 +567,15 @@ def parse_bimi_record( response.raise_for_status() raw_xml = response.content except Exception as e: - warnings.append(f"Unable to download {tag_value} - {str(e)}") + warnings.append(f"Failed to download BIMI image at {tag_value} - {str(e)}") if raw_xml is not None: try: image_metadata = get_svg_metadata(raw_xml) - warnings += check_svg_requirements(image_metadata) + svg_validation_errors = check_svg_requirements(image_metadata) + if len(svg_validation_errors) > 0: + image_metadata["validation_errors"] = svg_validation_errors except Exception as e: - warnings.append(str(e)) + warnings.append(f"Failed to process BIMI image at {tag_value} - {str(e)}") elif tag == "a" and tag_value != "": cert_metadata = None try: