here's the problem: I have a list of authorization headers to check. For that, I use aiohhtp
def make_tasks(session, proxies, unchecked_headers):
tasks = list()
for unchecked_header in unchecked_headers:
current_proxy = proxies.pop()
headers['authorization'] = unchecked_header
t = session.get(url, proxy=current_proxy, headers=headers)
tasks.append(t)
return tasks
async def check_headers(proxies, unchecked_headers):
async with aiohttp.ClientSession() as s:
tasks = make_tasks(s, proxies, unchecked_headers)
results = await asyncio.gather(*tasks)
for result in results:
...
Now, depending on the response code, I need to log some information about that authorization header. The issue is that no where in the response it mentions the actual header. So, I get all of the responses back, yet I don't know which response corresponds to which header, as they are asynchronous.
I looked around, and didn't find a way to check which headers were sent initially on the ClientResponse object. What can I do here?