From 130300824b923888687e6e7d1c8bf35a8c95c892 Mon Sep 17 00:00:00 2001 From: joamag Date: Wed, 30 Dec 2015 18:50:16 +0000 Subject: [PATCH] new bytes conversion in chunked encoding (fixes python 3) --- src/netius/servers/http.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/netius/servers/http.py b/src/netius/servers/http.py index a34d4c91f..bb291a4ab 100644 --- a/src/netius/servers/http.py +++ b/src/netius/servers/http.py @@ -181,13 +181,13 @@ def send_chunked(self, data, delay = False, callback = None): # creates the various parts of the chunk with the size # of the data that is going to be sent and then adds # each of the parts to the chunk buffer list - buffer.append("%x\r\n" % size) + buffer.append(netius.legacy.bytes("%x\r\n" % size)) buffer.append(data) - buffer.append("\r\n") + buffer.append(netius.legacy.bytes("\r\n")) # joins the buffer containing the chunk parts and then # sends it to the connection using the plain method - buffer_s = "".join(buffer) + buffer_s = b"".join(buffer) self.send_plain(buffer_s, delay = delay, callback = callback) def send_gzip(self, data, delay = False, callback = None, level = 6):