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

Method is_same_site

pywebio/platform/utils.py:46–53  ·  view source on GitHub ↗

判断 origin 和 host 是否一致。origin 和 host 都为http协议请求头

(origin, host)

Source from the content-addressed store, hash-verified

44
45 @staticmethod
46 def is_same_site(origin, host):
47 """判断 origin 和 host 是否一致。origin 和 host 都为http协议请求头"""
48 parsed_origin = urllib.parse.urlparse(origin)
49 origin = parsed_origin.netloc
50 origin = origin.lower()
51
52 # Check to see that origin matches host directly, including ports
53 return origin == host
54
55
56def deserialize_binary_event(data: bytes):

Callers 2

webio_routesFunction · 0.80
check_originMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected