mirror of
https://github.com/FAUSheppy/simple-webhook-handler
synced 2025-12-08 13:08:33 +01:00
add unique error message for missing json data
This commit is contained in:
@@ -20,6 +20,11 @@ def rootPage():
|
|||||||
return "Webhook Listener ist running"
|
return "Webhook Listener ist running"
|
||||||
else:
|
else:
|
||||||
data = flask.request.json
|
data = flask.request.json
|
||||||
|
if data == None:
|
||||||
|
retString = "POST-request is missing payload."
|
||||||
|
print(retString, file=sys.stderr)
|
||||||
|
return (retString, 400)
|
||||||
|
|
||||||
print(json.dumps(flask.request.json, indent=4, sort_keys=True))
|
print(json.dumps(flask.request.json, indent=4, sort_keys=True))
|
||||||
|
|
||||||
# check for project in request
|
# check for project in request
|
||||||
|
|||||||
Reference in New Issue
Block a user