(origin, handler: tornado.websocket.WebSocketHandler)
| 55 | |
| 56 | |
| 57 | def _is_same_site(origin, handler: tornado.websocket.WebSocketHandler): |
| 58 | parsed_origin = urlparse(origin) |
| 59 | origin = parsed_origin.netloc |
| 60 | origin = origin.lower() |
| 61 | |
| 62 | host = handler.request.headers.get("Host") |
| 63 | |
| 64 | # Check to see that origin matches host directly, including ports |
| 65 | return origin == host |
| 66 | |
| 67 | |
| 68 | class WebSocketConnection(ws_adaptor.WebSocketConnection): |
no test coverage detected
searching dependent graphs…