Don’t accept cancel or update via broadcast API

We don’t support these methods at the moment. Instead we were just
ignoring the `msgType` field, so issuing one of these commands would
cause a new alert to be broadcast 🙃

We might want to support `Cancel` in the future, but for now let’s
reject anything that isn’t `Alert` (CAP terminology for the initial
broadcast).
This commit is contained in:
Chris Hill-Scott
2021-02-15 09:32:33 +00:00
parent a1e539e785
commit e8a79f5413
4 changed files with 212 additions and 2 deletions

View File

@@ -5,6 +5,7 @@ def cap_xml_to_dict(cap_xml):
# This function assumes that its being passed valid CAP XML
cap = BeautifulSoup(cap_xml, "xml")
return {
"msgType": cap.alert.msgType.text,
"reference": cap.alert.identifier.text,
"category": cap.alert.info.category.text,
"expires": cap.alert.info.expires.text,