From 2ba8d74fa7e104ddfaac365c1efe1bb99c632ed3 Mon Sep 17 00:00:00 2001 From: Jan Friedli Date: Tue, 14 Jul 2020 22:49:24 +0200 Subject: catch no bulk post body --- matweb/rest_api.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'matweb') diff --git a/matweb/rest_api.py b/matweb/rest_api.py index 429b82e..2909cf6 100644 --- a/matweb/rest_api.py +++ b/matweb/rest_api.py @@ -106,6 +106,8 @@ class APIBulkDownloadCreator(Resource): def post(self): utils.check_upload_folder(current_app.config['UPLOAD_FOLDER']) data = request.json + if not data: + abort(400, message="Post Body Required") if not self.v.validate(data): abort(400, message=self.v.errors) # prevent the zip file from being overwritten -- cgit v1.3