Add link to magic string

This commit is contained in:
mcarlton00 2020-02-12 17:22:49 -05:00
parent 07c9fffab7
commit e30e6dca8a

View file

@ -545,7 +545,9 @@ class WebSocket(object):
return False
result = result.lower()
value = key + "258EAFA5-E914-47DA-95CA-C5AB0DC85B11".encode()
# https://tools.ietf.org/html/rfc6455#page-6
magic_string = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11".encode()
value = key + magic_string
hashed = base64.encodestring(hashlib.sha1(value).digest()).strip().lower().decode()
return hashed == result