Skip to content

Commit 119d883

Browse files
committed
Fix recursion in GitHubTagsAPI
A minor bug was introduced by 775aa1d which was crashing the nginx importer. Signed-off-by: Hritik Vijay <hritikxx8@gmail.com>
1 parent 475bb96 commit 119d883

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

vulnerabilities/package_managers.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -372,14 +372,14 @@ class GitHubTagsAPI(VersionAPI):
372372

373373
package_type = "github"
374374

375-
async def fetch(self, owner_repo: str, session) -> None:
375+
async def fetch(self, owner_repo: str, session, endpoint=None) -> None:
376376
"""
377377
owner_repo is a string of format "{repo_owner}/{repo_name}"
378378
Example value of owner_repo = "nexB/scancode-toolkit"
379379
"""
380380
self.cache[owner_repo] = set()
381-
endpoint = f"https://github.com/{owner_repo}/tags"
382-
381+
if not endpoint:
382+
endpoint = f"https://github.com/{owner_repo}/tags"
383383
resp = await session.get(endpoint)
384384
resp = await resp.read()
385385

@@ -406,7 +406,7 @@ async def fetch(self, owner_repo: str, session) -> None:
406406

407407
if url:
408408
# FIXME: this could be asynced to improve performance
409-
await self.fetch(owner_repo, url)
409+
await self.fetch(owner_repo, session, url)
410410

411411

412412
class HexVersionAPI(VersionAPI):

0 commit comments

Comments
 (0)