Skip to content

Commit

Permalink
[!] fix input body check
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhongFuze committed May 26, 2024
1 parent dca04fe commit c86c79e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/controller/allocation_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Author: Zella Zhong
Date: 2024-05-23 22:47:04
LastEditors: Zella Zhong
LastEditTime: 2024-05-24 05:44:35
LastEditTime: 2024-05-26 16:57:04
FilePath: /id_allocation/src/controller/allocation_controller.py
Description: allocation controller
'''
Expand Down Expand Up @@ -45,6 +45,10 @@ def allocation(self):
}
'''
post_data = self.inout.request.body
if post_data is None:
return httpsvr.Resp(msg="Invalid input body", data=None, code=-1)
if post_data == "":
return httpsvr.Resp(msg="Invalid input body", data=None, code=-1)
data = json.loads(post_data)
graph_id = data.get("graph_id", "")
updated_nanosecond = data.get("updated_nanosecond", 0)
Expand All @@ -54,7 +58,6 @@ def allocation(self):
if len(vids) == 0:
return httpsvr.Resp(msg="Invalid input body", data=None, code=-1)


data = None
rows = []
code = 0
Expand Down

0 comments on commit c86c79e

Please sign in to comment.