Closed h3llrais3r closed 5 years ago
@Lawouach Can you review it, merge and release it if you agree? This issue is blocking my websockets on py3 in combination with cherrypy. Thanks!
I think this as a bug in CherryPy that has been fixed and released in 18.0.1
https://github.com/cherrypy/cherrypy/issues/1738#issuecomment-419641132
Mind trying updating CherryPy just to see if that helps before we decide to merge this one?
Thanks.
@Lawouach I cannot upgrade to CherryPy 18.0.0 or above because it's Python3 only. I need support for both Python2 and Python3 and the latest version is 17.4.0.
I find it a bit strange that you did the same decoding for the wsgiutils.py
, so I would assume that you do it also for cherrypyserver.py
. :wink:
Please reconcider merging this one because versions below 18.0.0 of cherrypy should be able to work also with this fix.
Other solution is backporting the fix made in 18.0.1 to the 17.x maintenance branch. I tried it and this also works.
@jaraco Any thoughts on that?
I leave it up to you 2 guys to decide where it should be fixed. :wink:
@Lawouach, @jaraco, in which project do you think it should be fixed? If needed, I can also make the PR for CherryPy with the changes as described in my previous comment.
I can merge it in this project but I'm away until next week. I'll try to cut a new release by Wednesday.
I don't know if the CherryPy project will backport though.
Happy to have bugfixes applied to 17.x. @h3llrais3r , would you make the PR? Just target the pr to the maint/17.x
branch in CP and reference the bug/PR/commit that fixed it for 18.x? Thanks.
@Lawouach, @jaraco I've provided the PR for both libraries... For which option will we go? Or perhaps for both?
Since the change was made in the master branch of CherryPy (https://github.com/cherrypy/cherrypy/issues/1738#issuecomment-419641132) I feel there would be symmetry in using your PR you submitted over there.
@Lawouach, I see that @jaraco has just merged it in the cherrypy:maint/17.x branch, so it should be fixed. 👍
For cherrypyserver on Python 3 and above (tested with Python 3.6) Same logic applied as in wsgiutils.py
Screenshot of issue:
As you can see, the value of the 'Sec-Websocket-Accept' header is in the wrong format. It must be decoded when running Py3.