fixed httpserver python 3.x issue

This commit is contained in:
Adolfo Gómez García 2019-07-09 13:26:44 +02:00
parent 45db8592b7
commit 7cf4659f5f

View File

@ -116,8 +116,8 @@ class HTTPServerHandler(BaseHTTPServer.BaseHTTPRequestHandler):
try:
HTTPServerHandler.lock.acquire()
length = int(self.headers.getheader('content-length'))
content = self.rfile.read(length)
length = int(self.headers.get('content-length'))
content = self.rfile.read(length).decode('utf8')
logger.debug('length: {}, content >>{}<<'.format(length, content))
params = json.loads(content)
@ -174,11 +174,6 @@ class HTTPServerHandler(BaseHTTPServer.BaseHTTPRequestHandler):
# TODO: Return something useful? :)
return 'Up and running'
def get_refresh(self, params):
'''
Requests a refresh of own information offered from UDS Server
'''
def get_uuid(self, params):
return self.service.api.uuid