MCPcopy Create free account
hub / github.com/pywebio/PyWebIO / _is_same_site

Function _is_same_site

pywebio/platform/tornado.py:57–65  ·  view source on GitHub ↗
(origin, handler: tornado.websocket.WebSocketHandler)

Source from the content-addressed store, hash-verified

55
56
57def _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
68class WebSocketConnection(ws_adaptor.WebSocketConnection):

Callers 2

_check_originFunction · 0.70
webio_handlerFunction · 0.70

Calls 1

getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…