Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Teaing opened this issue Mar 11, 2024 · 0 comments
Open

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

Teaing opened this issue Mar 11, 2024 · 0 comments

Comments

@Teaing
Copy link

Teaing commented Mar 11, 2024

/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']

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant