模块优化

This commit is contained in:
Jing Ling
2020-08-15 16:37:10 +08:00
parent 5e75502c48
commit cbe3da1d66
4 changed files with 5 additions and 13 deletions
+1 -4
View File
@@ -27,10 +27,7 @@ class CheckCDX(Module):
self.header = self.get_header()
self.proxy = self.get_proxy(self.source)
resp = self.get(url, check=False)
if not resp:
return
if resp and len(resp.content):
self.subdomains = self.match_subdomains(resp.text)
self.subdomains = self.collect_subdomains(resp)
def run(self):
"""
+2 -1
View File
@@ -49,7 +49,8 @@ class CheckCSP(Module):
logger.log('DEBUG', f'Failed to get header of {self.domain} domain')
return
if not csp:
logger.log('DEBUG', f'There is no Content-Security-Policy in the header of {self.domain}')
logger.log('DEBUG', f'There is no Content-Security-Policy in the header '
f'of {self.domain}')
return
self.subdomains = self.match_subdomains(csp)
+1 -4
View File
@@ -26,10 +26,7 @@ class CheckRobots(Module):
self.header = self.get_header()
self.proxy = self.get_proxy(self.source)
resp = self.get(url, check=False, allow_redirects=False)
if not resp:
return
if resp and len(resp.content):
self.subdomains = self.match_subdomains(resp.text)
self.subdomains = self.collect_subdomains(resp)
def run(self):
"""
+1 -4
View File
@@ -31,10 +31,7 @@ class CheckRobots(Module):
self.proxy = self.get_proxy(self.source)
self.timeout = 10
resp = self.get(url, check=False)
if not resp:
return
if resp and len(resp.content):
self.subdomains = self.match_subdomains(resp.text)
self.subdomains = self.collect_subdomains(resp)
def run(self):
"""