obs_operator: handle empty body POST request.
This commit is contained in:
parent
701e5ea2d1
commit
7bf860c8cb
@ -111,6 +111,8 @@ class RequestHandler(BaseHTTPRequestHandler):
|
|||||||
self.write_string(str(e))
|
self.write_string(str(e))
|
||||||
|
|
||||||
def data_parse(self):
|
def data_parse(self):
|
||||||
|
if int(self.headers['Content-Length']) == 0:
|
||||||
|
return {}
|
||||||
data = self.rfile.read(int(self.headers['Content-Length']))
|
data = self.rfile.read(int(self.headers['Content-Length']))
|
||||||
return json.loads(data.decode('utf-8'))
|
return json.loads(data.decode('utf-8'))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user