From c6a7e5446b32de4c5158ac68720da660eb7df5db Mon Sep 17 00:00:00 2001 From: Maxime Borges Date: Wed, 31 Aug 2022 00:08:13 +0200 Subject: [PATCH] HTTP: Fix missing ascii encoding in connection send --- pypxe/http.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pypxe/http.py b/pypxe/http.py index 1dfa483..086a646 100644 --- a/pypxe/http.py +++ b/pypxe/http.py @@ -83,7 +83,7 @@ def handle_request(self, connection, addr): response += 'Content-Length: {0}\r\n'.format(os.path.getsize(target)) response += '\r\n' if method == 'HEAD': - connection.send(response) + connection.send(response.encode('ascii')) connection.close() self.logger.debug('Sending message to {0}'.format(repr(addr))) self.logger.debug('<--BEING MESSAGE-->')