Open
Description
I was getting the bellow error:
[ali@koalasec batchql]$ python3 batch.py -e https://api.target.com/graphql/ --header "Api-Key: 999999999"
Traceback (most recent call last):
File "/home/ali/tools/batchql/batch.py", line 28, in <module>
point_index = header.find(":")
^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'find'
However i was able to solve the issue by modify the code to:
if args.header:
for header in args.header:
if isinstance(header, list):
header = header[0]
if ":" in header: # Ensure the format is correct
point_index = header.find(":")
header_dict[header[:point_index].strip()] = header[point_index+1:].strip()
else:
print(f"Invalid header format: {header}")
instead of:
if args.header:
for header in args.header:
point_index = header.find(":")
header_dict[header[:point_index].strip()] = header[point_index+1:].strip()
Metadata
Metadata
Assignees
Labels
No labels