Refactor code for readability and compatibility.
This commit is contained in:
parent
a09835049b
commit
c6d9c0619e
43 changed files with 129 additions and 112 deletions
|
|
@ -99,6 +99,7 @@ def http_headers(s):
|
|||
key, value = [i.strip() for i in line.split(":", 1)]
|
||||
d[key] = value
|
||||
except ValueError:
|
||||
# malformed header, skip it
|
||||
pass
|
||||
|
||||
return d
|
||||
|
|
@ -257,8 +258,8 @@ def parse_hybi07_frames(buf):
|
|||
if header & 0x70:
|
||||
# At least one of the reserved flags is set. Pork chop sandwiches!
|
||||
raise WSException("Reserved flag in HyBi-07 frame (%d)" % header)
|
||||
frames.append(("", CLOSE))
|
||||
return frames, buf
|
||||
#frames.append(("", CLOSE))
|
||||
#return frames, buf
|
||||
|
||||
# Get the opcode, and translate it to a local enum which we actually
|
||||
# care about.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue