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
1 changed files with 5 additions and 0 deletions
|
@ -84,6 +84,11 @@ class iOSNotificationService(BaseNotificationService):
|
|||
data[ATTR_DATA] = kwargs.get(ATTR_DATA)
|
||||
|
||||
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
|
||||
|
||||
req = requests.post(PUSH_URL, json=data, timeout=10)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue