From 3244980a35aa91b54af24df1a7c7955fed11b01d 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 1b484821788..5c61966808d 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("