From 3aa0294b5d6daf310f8f0bdb9c4aa283b5c3380f Mon Sep 17 00:00:00 2001 From: Dave T <17680170+davet2001@users.noreply.github.com> Date: Wed, 30 Mar 2022 23:45:55 +0100 Subject: [PATCH] Generic camera: Allow svg detect to accept leading whitespace (#68932) --- homeassistant/components/generic/config_flow.py | 2 +- tests/components/generic/test_config_flow.py | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/generic/config_flow.py b/homeassistant/components/generic/config_flow.py index 1b4848217888..5c61966808d4 100644 --- a/homeassistant/components/generic/config_flow.py +++ b/homeassistant/components/generic/config_flow.py @@ -114,7 +114,7 @@ def get_image_type(image): if fmt is None: # if imghdr can't figure it out, could be svg. with contextlib.suppress(UnicodeDecodeError): - if image.decode("utf-8").startswith("