判断 origin 和 host 是否一致。origin 和 host 都为http协议请求头
(origin, host)
| 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 | |
| 56 | def deserialize_binary_event(data: bytes): |
no outgoing calls
no test coverage detected