mirror of https://github.com/zulip/zulip.git
Handle any malformed JSON input instead of just an empty body
(imported from commit a8a99173697ab6fb1ec60cf499e40cde8b8549d5)
This commit is contained in:
parent
9ffbc6d4ab
commit
1902f6f149
|
@ -1578,10 +1578,10 @@ def api_jira_webhook(request):
|
|||
except (AttributeError, KeyError):
|
||||
return json_error("Missing api_key parameter.")
|
||||
|
||||
if request.body == '':
|
||||
return json_error("No XML POST data!")
|
||||
|
||||
payload = simplejson.loads(request.body)
|
||||
try:
|
||||
payload = simplejson.loads(request.body)
|
||||
except simplejson.JSONDecodeError:
|
||||
return json_error("Malformed JSON input")
|
||||
|
||||
try:
|
||||
stream = request.GET['stream']
|
||||
|
|
Loading…
Reference in New Issue