Show More
@@ -94,6 +94,19 b" if os.environ.get('IPYTHON_ALLOW_DRAFT_WEBSOCKETS_FOR_PHANTOMJS', False):" | |||||
94 |
|
94 | |||
95 | class ZMQStreamHandler(WebSocketHandler): |
|
95 | class ZMQStreamHandler(WebSocketHandler): | |
96 |
|
96 | |||
|
97 | if tornado.version_info < (4,1): | |||
|
98 | """Backport send_error from tornado 4.1 to 4.0""" | |||
|
99 | def send_error(self, *args, **kwargs): | |||
|
100 | if self.stream is None: | |||
|
101 | super(WebSocketHandler, self).send_error(*args, **kwargs) | |||
|
102 | else: | |||
|
103 | # If we get an uncaught exception during the handshake, | |||
|
104 | # we have no choice but to abruptly close the connection. | |||
|
105 | # TODO: for uncaught exceptions after the handshake, | |||
|
106 | # we can close the connection more gracefully. | |||
|
107 | self.stream.close() | |||
|
108 | ||||
|
109 | ||||
97 | def check_origin(self, origin): |
|
110 | def check_origin(self, origin): | |
98 | """Check Origin == Host or Access-Control-Allow-Origin. |
|
111 | """Check Origin == Host or Access-Control-Allow-Origin. | |
99 |
|
112 |
General Comments 0
You need to be logged in to leave comments.
Login now