Use the json load helper in a few more incoming web requests (#90194)

* Use the json load helper in a few more incoming web requests

* drop hassio change as there is no coverage there

* Remove everything except emulated_hue since its has its own site/web
This commit is contained in:
J. Nick Koston 2023-03-24 09:38:08 -10:00 committed by GitHub
parent 72b09bfee7
commit 8e07b71644
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -64,6 +64,7 @@ from homeassistant.const import (
)
from homeassistant.core import State
from homeassistant.helpers.event import async_track_state_change_event
from homeassistant.util.json import json_loads
from homeassistant.util.network import is_local
from .config import Config
@ -138,7 +139,7 @@ class HueUsernameView(HomeAssistantView):
return self.json_message("Only local IPs allowed", HTTPStatus.UNAUTHORIZED)
try:
data = await request.json()
data = await request.json(loads=json_loads)
except ValueError:
return self.json_message("Invalid JSON", HTTPStatus.BAD_REQUEST)