You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 29, 2022. It is now read-only.
Is it OK that key and self.GUID do not use encode('utf-8') method?
I met an exception:
File "~/geventwebsocket/handler.py", line 219, in upgrade_connection
hashlib.sha1(key + self.GUID).digest())), TypeError: Unicode-objects must be encoded before hashing
my dev environment:
Python3.5
gevent 1.1.2
gevent-websocket 0.95
I tried to encode the key and self.GUID, but I met other errors then : UnicodeError("The value must be a native string", header, value)
this occurs at pywsgi.py at function start_response() because the value of sec websocket key is a byte object.
Of course I change it to a str, then I met other error.....
Thanks for checking this issue.
The text was updated successfully, but these errors were encountered:
Just now I read the Readme.md and learned that I should use gunicorn to deploy. Let me try again. I am sorry that I missed the important information in Readme...
Hello.
in geventwebsocket/handler.py
headers = [ ("Upgrade", "websocket"), ("Connection", "Upgrade"), ("Sec-WebSocket-Accept", base64.b64encode( hashlib.sha1(key + self.GUID).digest())), ]
Is it OK that key and self.GUID do not use encode('utf-8') method?
I met an exception:
File "~/geventwebsocket/handler.py", line 219, in upgrade_connection
hashlib.sha1(key + self.GUID).digest())),
TypeError: Unicode-objects must be encoded before hashing
my dev environment:
Python3.5
gevent 1.1.2
gevent-websocket 0.95
I tried to encode the key and self.GUID, but I met other errors then :
UnicodeError("The value must be a native string", header, value)
this occurs at pywsgi.py at function start_response() because the value of sec websocket key is a byte object.
Of course I change it to a str, then I met other error.....
Thanks for checking this issue.
The text was updated successfully, but these errors were encountered: