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:
parent
72b09bfee7
commit
8e07b71644
1 changed files with 2 additions and 1 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue