From 672ee91a925cff63bef2ea24f8b0c53646ed6586 Mon Sep 17 00:00:00 2001 From: lubbock Date: Thu, 30 May 2019 11:46:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dweb=E7=AB=AF=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E7=9B=AE=E5=BD=95=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 修复在web端输入目录提示url不合法问题 --- cobra/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cobra/api.py b/cobra/api.py index 4a8b7820..96552ef6 100644 --- a/cobra/api.py +++ b/cobra/api.py @@ -111,7 +111,7 @@ def post(): if isinstance(target, list): for t in target: # Scan - if re.match(r'http://|https://', t): + if re.match(r'http://|https://', t) or os.path.exists(t): arg = (t, formatter, output, rule, a_sid, is_del) producer(task=arg) @@ -124,7 +124,7 @@ def post(): 'total_target_num': len(target), } else: - if re.match(r'http://|https://', target): + if re.match(r'http://|https://', target) or os.path.exists(target): arg = (target, formatter, output, rule, a_sid, is_del) producer(task=arg)