remove latest \n in bosh received messages (one is added when we send)

This commit is contained in:
Yann Leboulanger 2009-04-07 17:12:35 +00:00
parent 8514e51675
commit d37d1e973f
1 changed files with 3 additions and 0 deletions

View File

@ -687,6 +687,9 @@ class NonBlockingHTTP(NonBlockingTCP):
httpbody - string with http body)
'''
message = message.replace('\r','')
# Remove latest \n
if message.endswith('\n'):
message = message[:-1]
(header, httpbody) = message.split('\n\n', 1)
header = header.split('\n')
statusline = header[0].split(' ', 2)