@@ -59,17 +59,17 @@ class TaskService(object):
5959 def __init__ (self ):
6060 pass
6161
62- def _create_task_sync (self , remote_addr : str , scanUrl : str , host , headers : list , body : str , options : dict , taskid : str ):
62+ def _create_task_sync (self , remote_addr : str , scanUrl : str , host , method : str , headers : list , body : str , options : dict , taskid : str ):
6363 """同步创建任务(在线程池中执行)"""
6464 with DataStore .tasks_lock :
65- DataStore .tasks [taskid ] = Task (taskid , remote_addr , scanUrl , host , headers , body )
65+ DataStore .tasks [taskid ] = Task (taskid , remote_addr , scanUrl , host , method , headers , body )
6666 for option in options :
6767 logger .debug (f"option: { option } , value: { options [option ]} " )
6868 DataStore .tasks [taskid ].set_option (option , options [option ])
6969 DataStore .tasks [taskid ].status = TaskStatus .Runnable
7070 return DataStore .tasks [taskid ].engine_get_id ()
7171
72- async def star_task (self , remote_addr : str , scanUrl : str , host , headers : list , body : str , options : dict ):
72+ async def star_task (self , remote_addr : str , scanUrl : str , host , method : str , headers : list , body : str , options : dict ):
7373 option_check_res = validate_options (options )
7474 if option_check_res is not None :
7575 return option_check_res
@@ -81,7 +81,7 @@ async def star_task(self, remote_addr: str, scanUrl: str, host, headers: list, b
8181 engine_id = await loop .run_in_executor (
8282 self ._executor ,
8383 self ._create_task_sync ,
84- remote_addr , scanUrl , host , headers , body , options , taskid
84+ remote_addr , scanUrl , host , method , headers , body , options , taskid
8585 )
8686 return BaseResponseMsg (
8787 data = {"engineid" : engine_id , "taskid" : taskid },
@@ -528,6 +528,7 @@ def _get_task_http_request_info_sync(self, taskId):
528528 task = DataStore .tasks [taskId ]
529529 http_info = {
530530 "url" : task .scanUrl ,
531+ "method" : task .method ,
531532 "headers" : task .headers ,
532533 "body" : task .body ,
533534 }
0 commit comments