From e5c4c9de36c158a103ba1abb8d09e6ab36c7dc88 Mon Sep 17 00:00:00 2001 From: NotoriousRebel Date: Mon, 30 Dec 2019 23:07:38 -0500 Subject: [PATCH] Added docstring. --- theHarvester/discovery/netcraft.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/theHarvester/discovery/netcraft.py b/theHarvester/discovery/netcraft.py index ac18edc9..966aa385 100644 --- a/theHarvester/discovery/netcraft.py +++ b/theHarvester/discovery/netcraft.py @@ -25,6 +25,7 @@ def __init__(self, word): async def request(self, url, first=False): try: if first: + # indicates first request to extract cookie async with aiohttp.ClientSession(headers=self.headers, timeout=self.timeout) as sess: async with sess.get(url) as resp: await asyncio.sleep(3) @@ -57,6 +58,7 @@ async def create_cookies(self, cookie): async def get_cookies(self, headers): try: if headers is None: + # In this case just return default dict return {} elif 'set-cookie' in headers: cookies = await self.create_cookies(headers['set-cookie'])