obs_operator: handle empty body POST request.

This commit is contained in:
Jimmy Berry 2019-05-01 15:04:10 -05:00
parent 701e5ea2d1
commit 7bf860c8cb

View File

@ -111,6 +111,8 @@ class RequestHandler(BaseHTTPRequestHandler):
self.write_string(str(e))
def data_parse(self):
if int(self.headers['Content-Length']) == 0:
return {}
data = self.rfile.read(int(self.headers['Content-Length']))
return json.loads(data.decode('utf-8'))