From d9b940c21e7729da1b6a63d8e82cd3ad4a82f775 Mon Sep 17 00:00:00 2001 From: Shadab Zafar Date: Wed, 8 Jun 2016 16:37:56 +0530 Subject: Py3: websockets --- netlib/websockets/protocol.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'netlib/websockets') diff --git a/netlib/websockets/protocol.py b/netlib/websockets/protocol.py index c1b7be2c..af0eef7d 100644 --- a/netlib/websockets/protocol.py +++ b/netlib/websockets/protocol.py @@ -20,7 +20,7 @@ import os import six -from netlib import http +from netlib import http, strutils websockets_magic = b'258EAFA5-E914-47DA-95CA-C5AB0DC85B11' VERSION = "13" @@ -109,4 +109,4 @@ class WebsocketsProtocol(object): @classmethod def create_server_nonce(self, client_nonce): - return base64.b64encode(hashlib.sha1(client_nonce + websockets_magic).digest()) + return base64.b64encode(hashlib.sha1(strutils.always_bytes(client_nonce) + websockets_magic).digest()) -- cgit v1.2.3