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

Function _is_same_site

pywebio/platform/aiohttp.py:35–42  ·  view source on GitHub ↗

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

(origin, host)

Source from the content-addressed store, hash-verified

33
34
35def _is_same_site(origin, host):
36 """判断 origin 和 host 是否一致。origin 和 host 都为http协议请求头"""
37 parsed_origin = urlparse(origin)
38 origin = parsed_origin.netloc
39 origin = origin.lower()
40
41 # Check to see that origin matches host directly, including ports
42 return origin == host
43
44
45class WebSocketConnection(ws_adaptor.WebSocketConnection):

Callers 2

_check_originFunction · 0.70
webio_handlerFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…