Skip to content

Commit

Permalink
new bytes conversion in chunked encoding (fixes python 3)
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Dec 30, 2015
1 parent 2d55911 commit 1303008
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/netius/servers/http.py
Expand Up @@ -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):
Expand Down

0 comments on commit 1303008

Please sign in to comment.