mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 14:27:07 +00:00
Remove unneeded startswith in content check of image upload (#98599)
This commit is contained in:
parent
89705a22cf
commit
2f204d5747
@ -78,8 +78,10 @@ class ImageStorageCollection(collection.DictStorageCollection):
|
|||||||
data = self.CREATE_SCHEMA(dict(data))
|
data = self.CREATE_SCHEMA(dict(data))
|
||||||
uploaded_file: FileField = data["file"]
|
uploaded_file: FileField = data["file"]
|
||||||
|
|
||||||
if not uploaded_file.content_type.startswith(
|
if uploaded_file.content_type not in (
|
||||||
("image/gif", "image/jpeg", "image/png")
|
"image/gif",
|
||||||
|
"image/jpeg",
|
||||||
|
"image/png",
|
||||||
):
|
):
|
||||||
raise vol.Invalid("Only jpeg, png, and gif images are allowed")
|
raise vol.Invalid("Only jpeg, png, and gif images are allowed")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user