Fix MSSP byte error when mixing with unicode
This commit is contained in:
parent
7a47c569eb
commit
64acd33d85
3 changed files with 14 additions and 5 deletions
|
|
@ -23,14 +23,17 @@ Update to Python 3
|
||||||
|
|
||||||
### Web
|
### Web
|
||||||
|
|
||||||
New golden-layout based Webclient UI (@security-related)
|
- Change webclient to use Autobahn websocket library (which is actually maintained)
|
||||||
|
|
||||||
|
#### New golden-layout based Webclient UI (@friarzen)
|
||||||
- Features
|
- Features
|
||||||
- Much slicker behavior and more professional look
|
- Much slicker behavior and more professional look
|
||||||
- Allows tabbing as well as click and drag of panes in any grid position
|
- Allows tabbing as well as click and drag of panes in any grid position
|
||||||
- Renaming tabs, assignments of data tags and output types are simple per-pane menus now
|
- Renaming tabs, assignments of data tags and output types are simple per-pane menus now
|
||||||
- Any number of input panes, with separate histories
|
- Any number of input panes, with separate histories
|
||||||
- Button UI (disabled in JS by default)
|
- Button UI (disabled in JS by default)
|
||||||
Web/Django standard initiative (@strikaco)
|
|
||||||
|
#### Web/Django standard initiative (@strikaco)
|
||||||
- Features
|
- Features
|
||||||
- Adds a series of web-based forms and generic class-based views
|
- Adds a series of web-based forms and generic class-based views
|
||||||
- Accounts
|
- Accounts
|
||||||
|
|
@ -79,7 +82,6 @@ Web/Django standard initiative (@strikaco)
|
||||||
raises a KeyError exception if query gave 0 or >1 results.
|
raises a KeyError exception if query gave 0 or >1 results.
|
||||||
- `evennia.prototypes.spawner` can now spawn by passing a `prototype_key`
|
- `evennia.prototypes.spawner` can now spawn by passing a `prototype_key`
|
||||||
|
|
||||||
|
|
||||||
### Typeclasses
|
### Typeclasses
|
||||||
|
|
||||||
- Add new methods on all typeclasses, useful specifically for object handling from the website/admin:
|
- Add new methods on all typeclasses, useful specifically for object handling from the website/admin:
|
||||||
|
|
|
||||||
|
|
@ -196,9 +196,9 @@ class Mssp(object):
|
||||||
value = value()
|
value = value()
|
||||||
if utils.is_iter(value):
|
if utils.is_iter(value):
|
||||||
for partval in value:
|
for partval in value:
|
||||||
varlist += MSSP_VAR + str(variable) + MSSP_VAL + str(partval)
|
varlist += MSSP_VAR + bytes(variable, 'utf-8') + MSSP_VAL + bytes(partval, 'utf-8')
|
||||||
else:
|
else:
|
||||||
varlist += MSSP_VAR + str(variable) + MSSP_VAL + str(value)
|
varlist += MSSP_VAR + bytes(variable, 'utf-8') + MSSP_VAL + bytes(value, 'utf-8')
|
||||||
|
|
||||||
# send to crawler by subnegotiation
|
# send to crawler by subnegotiation
|
||||||
self.protocol.requestNegotiation(MSSP, varlist)
|
self.protocol.requestNegotiation(MSSP, varlist)
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,13 @@ class WebSocketClient(WebSocketServerProtocol, Session):
|
||||||
client_address = client_address[0] if client_address else None
|
client_address = client_address[0] if client_address else None
|
||||||
self.init_session("websocket", client_address, self.factory.sessionhandler)
|
self.init_session("websocket", client_address, self.factory.sessionhandler)
|
||||||
|
|
||||||
|
from evennia.utils import logger
|
||||||
|
try:
|
||||||
|
csessid = self.http_request_uri.split("?", 1)[1]
|
||||||
|
logger.log_msg("csessid: ", csessid)
|
||||||
|
except Exception:
|
||||||
|
logger.log_trace(str(self.__dict__))
|
||||||
|
|
||||||
csession = self.get_client_session()
|
csession = self.get_client_session()
|
||||||
uid = csession and csession.get("webclient_authenticated_uid", None)
|
uid = csession and csession.get("webclient_authenticated_uid", None)
|
||||||
if uid:
|
if uid:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue