Commit 3927db7c authored by Yann Leboulanger's avatar Yann Leboulanger
Browse files

[Dave Cridland] Fix BOSH for bodies with "\r\n" sequences

parent 635d9a02
......@@ -740,15 +740,15 @@ def parse_http_message(self, message):
httpbody - string with http body)
http_rest - what is left in the message after a full HTTP header + body
"""
message = message.replace('\r', '')
message = message.lstrip('\n')
splitted = message.split('\n\n')
splitted = message.split('\r\n\r\n')
if len(splitted) < 2:
# no complete http message. Keep filling the buffer until we find one
buffer_rest = message
return ('', '', '', buffer_rest)
else:
(header, httpbody) = splitted[:2]
header = header.replace('\r', '')
header = header.lstrip('\n')
header = header.split('\n')
statusline = header[0].split(' ', 2)
header = header[1:]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment