mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 19:27:45 +00:00
remove charset if set in content type header (#7411)
* remove charset if set in content type header like this “Content-Type: image/jpeg;charset=UTF-8” * fixed lint error
This commit is contained in:
parent
f9627a5646
commit
f389266f5f
@ -916,7 +916,8 @@ def _async_fetch_image(hass, url):
|
|||||||
|
|
||||||
if response.status == 200:
|
if response.status == 200:
|
||||||
content = yield from response.read()
|
content = yield from response.read()
|
||||||
content_type = response.headers.get(CONTENT_TYPE_HEADER)
|
content_type = response.headers.get(CONTENT_TYPE_HEADER)\
|
||||||
|
.split(';')[0]
|
||||||
|
|
||||||
except asyncio.TimeoutError:
|
except asyncio.TimeoutError:
|
||||||
pass
|
pass
|
||||||
|
Loading…
x
Reference in New Issue
Block a user