mirror of
https://github.com/home-assistant/core
synced 2024-10-07 10:13:38 +02:00
Don't allow sending to invalid iOS targets (#6115)
* Don't allow sending to invalid targets * Fix valid target check
This commit is contained in:
parent
b705b3ddb9
commit
846a0513c7
@ -84,6 +84,11 @@ class iOSNotificationService(BaseNotificationService):
|
|||||||
data[ATTR_DATA] = kwargs.get(ATTR_DATA)
|
data[ATTR_DATA] = kwargs.get(ATTR_DATA)
|
||||||
|
|
||||||
for target in targets:
|
for target in targets:
|
||||||
|
if target not in ios.enabled_push_ids():
|
||||||
|
_LOGGER.error("The target (%s) does not exist in ios.conf.",
|
||||||
|
targets)
|
||||||
|
return
|
||||||
|
|
||||||
data[ATTR_TARGET] = target
|
data[ATTR_TARGET] = target
|
||||||
|
|
||||||
req = requests.post(PUSH_URL, json=data, timeout=10)
|
req = requests.post(PUSH_URL, json=data, timeout=10)
|
||||||
|
Loading…
Reference in New Issue
Block a user