From cdfc1d88151a9f9f81082810db74fa3882d8adca Mon Sep 17 00:00:00 2001 From: Miguel Grinberg Date: Tue, 2 Feb 2021 10:00:15 +0000 Subject: [PATCH] Fix logging of missing sid (Fixes https://github.com/miguelgrinberg/Flask-SocketIO/issues/1472) --- engineio/server.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/engineio/server.py b/engineio/server.py index 703e7e95..7498f3f6 100644 --- a/engineio/server.py +++ b/engineio/server.py @@ -403,8 +403,9 @@ def handle_request(self, environ, start_response): del self.sockets[sid] elif method == 'POST': if sid is None or sid not in self.sockets: - self._log_error_once('Invalid session ' + sid, 'bad-sid') - r = self._bad_request('Invalid session ' + sid) + self._log_error_once( + 'Invalid session ' + (sid or 'None'), 'bad-sid') + r = self._bad_request('Invalid session ' + (sid or 'None')) else: socket = self._get_socket(sid) try: