判断 origin 和 host 是否一致。origin 和 host 都为http协议请求头
(origin, host)
| 33 | |
| 34 | |
| 35 | def _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 | |
| 45 | class WebSocketConnection(ws_adaptor.WebSocketConnection): |
no outgoing calls
no test coverage detected
searching dependent graphs…