Skip to content

Commit

Permalink
leakix tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Nov 18, 2024
1 parent c625d7a commit 80e48cf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
12 changes: 2 additions & 10 deletions bbot/modules/leakix.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,12 @@ class leakix(subdomain_enum_apikey):
}

base_url = "https://leakix.net"
ping_url = f"{base_url}/host/1.2.3.4.5"

async def setup(self):
ret = await super(subdomain_enum_apikey, self).setup()
self.headers = {"Accept": "application/json"}
self.api_key = self.config.get("api_key", "")
if self.api_key:
self.headers["api-key"] = self.api_key
return await self.require_api_key()
return ret
ping_url = f"{base_url}/host/1.1.1.1"

def prepare_api_request(self, url, kwargs):
if self.api_key:
kwargs["headers"]["api-key"] = self.api_key
kwargs["headers"]["Accept"] = "application/json"
return url, kwargs

async def request_url(self, query):
Expand Down
2 changes: 1 addition & 1 deletion bbot/test/test_step_2/module_tests/test_module_leakix.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class TestLeakIX(ModuleTestBase):

async def setup_before_prep(self, module_test):
module_test.httpx_mock.add_response(
url="https://leakix.net/host/1.2.3.4.5",
url="https://leakix.net/host/1.1.1.1",
match_headers={"api-key": "asdf"},
json={"title": "Not Found", "description": "Host not found"},
)
Expand Down

0 comments on commit 80e48cf

Please sign in to comment.