kennethreitz/flask-sockets — pull request #11 by offby1 (2013-12-12 21:37:36+00:00)
Title: SocketMiddleware.__call__: avoid exception when 'wsgi.websocket' isn't i...

...n the environment.

Such an exception is easy for a client to induce: they need merely
point a web browser at the relevant endpoint. And the exception might
take a long time to handle -- if we're running under gunicorn, it will
restart the worker; that takes tens or hundreds of milliseconds. This
way, the browser will probably get a 404, and the server process can
quickly get back to work.