Skip to content
This repository was archived by the owner on Apr 29, 2022. It is now read-only.

Commit d27c4ba

Browse files
author
Robert Aistleitner
committed
little bugfix to avoid exception on non-existing cookie
1 parent acad9bc commit d27c4ba

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

flask_sockets.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ def __call__(self, environ, start_response):
3939
try:
4040
handler, values = adapter.match()
4141
environment = environ['wsgi.websocket']
42-
cookie = parse_cookie(environ['HTTP_COOKIE'])
42+
cookie = None
43+
if 'HTTP_COOKIE' in environ:
44+
cookie = parse_cookie(environ['HTTP_COOKIE'])
4345

4446
with self.app.app_context():
4547
with self.app.request_context(environ):

0 commit comments

Comments
 (0)