Skip to content

Commit 7e41b96

Browse files
committed
fix(pypi): update get_maintainers_of_package to avoid request blocking
Signed-off-by: Amine <[email protected]>
1 parent 1c65d5f commit 7e41b96

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/macaron/slsa_analyzer/package_registry/pypi_registry.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,11 +244,10 @@ def get_package_page(self, package_name: str) -> str | None:
244244
str | None
245245
The package main page.
246246
"""
247-
url = os.path.join(self.registry_url, "project", package_name)
247+
url = f"https://pypi.org/project/{package_name}/"
248248
response = send_get_http_raw(url)
249249
if response:
250-
html_snippets = response.content.decode("utf-8")
251-
return html_snippets
250+
return response.text
252251
return None
253252

254253
def get_maintainers_of_package(self, package_name: str) -> list | None:

0 commit comments

Comments
 (0)