tests: Decode StreamRequestHandler read for python3

WPSAPHTTPServer class needs to explicitly decode the read value from
a bytes object to a str object.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
This commit is contained in:
Masashi Honma 2019-02-04 02:39:10 +02:00 committed by Jouni Malinen
parent 732b76139a
commit 59aecb1c42

View file

@ -4107,10 +4107,10 @@ def gen_wps_event(sid='uuid:7eb3342a-8a5f-47fe-a585-0785bfec6d8a'):
class WPSAPHTTPServer(StreamRequestHandler): class WPSAPHTTPServer(StreamRequestHandler):
def handle(self): def handle(self):
data = self.rfile.readline().strip() data = self.rfile.readline().decode().strip()
logger.info("HTTP server received: " + data) logger.info("HTTP server received: " + data)
while True: while True:
hdr = self.rfile.readline().strip() hdr = self.rfile.readline().decode().strip()
if len(hdr) == 0: if len(hdr) == 0:
break break
logger.info("HTTP header: " + hdr) logger.info("HTTP header: " + hdr)