mirror of
https://github.com/caronc/apprise-api.git
synced 2025-08-18 18:38:10 +02:00
enforce text based input
This commit is contained in:
@@ -399,8 +399,13 @@ class NotifyView(View):
|
|||||||
status=ResponseCode.internal_server_error,
|
status=ResponseCode.internal_server_error,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Prepare ourselves a default Asset
|
||||||
|
asset = apprise.AppriseAsset(
|
||||||
|
body_format=apprise.NotifyFormat.TEXT,
|
||||||
|
)
|
||||||
|
|
||||||
# Prepare our apprise object
|
# Prepare our apprise object
|
||||||
a_obj = apprise.Apprise()
|
a_obj = apprise.Apprise(asset=asset)
|
||||||
|
|
||||||
# Create an apprise config object
|
# Create an apprise config object
|
||||||
ac_obj = apprise.AppriseConfig()
|
ac_obj = apprise.AppriseConfig()
|
||||||
@@ -482,8 +487,13 @@ class StatelessNotifyView(View):
|
|||||||
_('An invalid payload was specified.'),
|
_('An invalid payload was specified.'),
|
||||||
status=ResponseCode.bad_request)
|
status=ResponseCode.bad_request)
|
||||||
|
|
||||||
|
# Prepare ourselves a default Asset
|
||||||
|
asset = apprise.AppriseAsset(
|
||||||
|
body_format=apprise.NotifyFormat.TEXT,
|
||||||
|
)
|
||||||
|
|
||||||
# Prepare our apprise object
|
# Prepare our apprise object
|
||||||
a_obj = apprise.Apprise()
|
a_obj = apprise.Apprise(asset=asset)
|
||||||
|
|
||||||
# Add URLs
|
# Add URLs
|
||||||
a_obj.add(content.get('urls'))
|
a_obj.add(content.get('urls'))
|
||||||
|
Reference in New Issue
Block a user