File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -259,25 +259,24 @@ def receiver(self):
259259 break
260260
261261 elif frame .opcode == OPCODE_CLOSE :
262- code = 1000
262+ code = 1005
263263 reason = ""
264264 if frame .payload_length == 0 :
265- self .closing = CloseControlMessage (code = 1000 )
265+ self .closing = CloseControlMessage (code = 1005 )
266266 elif frame .payload_length == 1 :
267- self .closing = CloseControlMessage (code = 1002 , reason = 'Payload has invalid length' )
267+ self .closing = CloseControlMessage (code = 1005 , reason = 'Payload has invalid length' )
268268 else :
269269 try :
270270 # at this stage, some_bytes have been unmasked
271271 # so actually are held in a bytearray
272272 code = int (unpack ("!H" , bytes (some_bytes [0 :2 ]))[0 ])
273273 except struct .error :
274- code = 1002
275274 reason = 'Failed at decoding closing code'
276275 else :
277276 # Those codes are reserved or plainly forbidden
278277 if code not in VALID_CLOSING_CODES and not (2999 < code < 5000 ):
279278 reason = 'Invalid Closing Frame Code: %d' % code
280- code = 1002
279+ code = 1005
281280 elif frame .payload_length > 1 :
282281 reason = some_bytes [2 :] if frame .masking_key else frame .body [2 :]
283282
You can’t perform that action at this time.
0 commit comments