Skip to content
Permalink
Browse files

增加任意域可信检测

  • Loading branch information...
saucer-man committed Sep 18, 2019
1 parent a489421 commit 3af8499c8860e203f1d3264f287c19d047fafd93
Showing with 17 additions and 1 deletion.
  1. +17 −1 common/corscheck.py
@@ -67,7 +67,23 @@ def check_cors_policy(self, test_module_name,test_origin,test_url):

if resp_headers == None:
return -1


"""----以下是我加的分割线----"""
if resp_headers.get("access-control-allow-origin") == "*":
credentials = "false"
if resp_headers.get("access-control-allow-credentials") == "true":
credentials = "true"

msg = {
"url": test_url,
"type": "test_allow_any_origin",
"credentials": "false",
"origin": test_origin,
"status_code" : status_code
}
return msg
"""----以上是我加的分割线----"""

parsed = urlparse(str(resp_headers.get("access-control-allow-origin")))
resp_origin = parsed.scheme + "://" + parsed.netloc.split(':')[0]

0 comments on commit 3af8499

Please sign in to comment.
You can’t perform that action at this time.