File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -256,13 +256,20 @@ class ApplicationHandler(BaseHandler):
256
256
def put (self , aname ):
257
257
try :
258
258
request_body = json .loads (self .request .body )
259
- pname = request_body ['package' ]
260
- except :
259
+ except ValueError :
261
260
self .send_client_error ("Invalid request body" )
262
261
return
263
262
263
+ if 'package' not in request_body :
264
+ self .send_client_error ("Invalid request body. Missing field 'package'" )
265
+ return
266
+
267
+ if 'user' not in request_body :
268
+ self .send_client_error ("Invalid request body. Missing field 'user'" )
269
+ return
270
+
264
271
def do_call ():
265
- dm .create_application (pname , aname , request_body )
272
+ dm .create_application (request_body [ 'package' ] , aname , request_body )
266
273
self .send_accepted ()
267
274
268
275
DISPATCHER .run_as_asynch (task = do_call , on_error = self .handle_error )
You can’t perform that action at this time.
0 commit comments