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
1 changed files with 2 additions and 1 deletions
|
@ -916,7 +916,8 @@ def _async_fetch_image(hass, url):
|
|||
|
||||
if response.status == 200:
|
||||
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:
|
||||
pass
|
||||
|
|
Loading…
Add table
Reference in a new issue