Skip to content

Commit

Permalink
Prevent AssertionError with Werkzeug when connection ends
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrinberg committed Mar 11, 2022
1 parent 0d9d0b5 commit f6142a6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/flask_sock/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ def __call__(self, *args, **kwargs):
return ALREADY_HANDLED
elif ws.mode == 'gunicorn':
raise StopIteration()
elif ws.mode == 'werkzeug':
raise ConnectionError()
else:
return []

Expand Down

0 comments on commit f6142a6

Please sign in to comment.