Fix WebSocketException: Invalid header
This commit is contained in:
parent
fdd07b77e3
commit
39d3e8acc9
1 changed files with 2 additions and 2 deletions
|
@ -485,7 +485,7 @@ class WebSocket(object):
|
||||||
headers.append("")
|
headers.append("")
|
||||||
headers.append("")
|
headers.append("")
|
||||||
|
|
||||||
header_str = "\n".join(headers)
|
header_str = "\r\n".join(headers)
|
||||||
self._send(header_str)
|
self._send(header_str)
|
||||||
if traceEnabled:
|
if traceEnabled:
|
||||||
log.debug("--- request header ---")
|
log.debug("--- request header ---")
|
||||||
|
@ -530,7 +530,7 @@ class WebSocket(object):
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
line = self._recv_line()
|
line = self._recv_line()
|
||||||
if line == "\n":
|
if line == "\r\n":
|
||||||
break
|
break
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
if traceEnabled:
|
if traceEnabled:
|
||||||
|
|
Loading…
Reference in a new issue