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

Method check_origin

pywebio/platform/utils.py:36–43  ·  view source on GitHub ↗
(cls, origin, allowed_origins, host)

Source from the content-addressed store, hash-verified

34
35 @classmethod
36 def check_origin(cls, origin, allowed_origins, host):
37 if cls.is_same_site(origin, host):
38 return True
39
40 return any(
41 fnmatch.fnmatch(origin, pattern)
42 for pattern in allowed_origins
43 )
44
45 @staticmethod
46 def is_same_site(origin, host):

Callers

nothing calls this directly

Calls 1

is_same_siteMethod · 0.80

Tested by

no test coverage detected