little bugfix to avoid exception on non-existing cookie

This commit is contained in:
Robert Aistleitner
2016-04-28 13:27:09 +02:00
parent acad9bc37b
commit d27c4ba2c9
+3 -1
View File
@@ -39,7 +39,9 @@ class SocketMiddleware(object):
try:
handler, values = adapter.match()
environment = environ['wsgi.websocket']
cookie = parse_cookie(environ['HTTP_COOKIE'])
cookie = None
if 'HTTP_COOKIE' in environ:
cookie = parse_cookie(environ['HTTP_COOKIE'])
with self.app.app_context():
with self.app.request_context(environ):