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

Function _check_origin

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

Source from the content-addressed store, hash-verified

45
46
47def _check_origin(origin, allowed_origins, handler: tornado.websocket.WebSocketHandler):
48 if _is_same_site(origin, handler):
49 return True
50
51 return any(
52 fnmatch.fnmatch(origin, pattern)
53 for pattern in allowed_origins
54 )
55
56
57def _is_same_site(origin, handler: tornado.websocket.WebSocketHandler):

Callers

nothing calls this directly

Calls 1

_is_same_siteFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…