fofapro / fofa-py

fofa pro的sdk,python语言版本
MIT License
150 stars 27 forks source link

/fofa/client.py 参数陷阱 #15

Open Teaing opened 6 months ago

Teaing commented 6 months ago

/fofa/client.py 第166行 def search_next(self, query_str, fields='', size=100, next='', full=False, opts={}): 建议opts使用None类型先判断参数

def search_next(self, query_str, fields='', size=100, next='', full=False, opts=None):
        if opts is None:
            opts = {}

或者208行

if next and next != '':
    param['next'] = next

修改为:

        if next:
            param['next'] = next
        # 如果 next 变量为空字符串,且 'next' 键已经存在于 param 字典中,则删除该键
        elif 'next' in param:
            del param['next']

其它参数位置使用{}作为默认参数同理