Page MenuHomeSoftware Heritage
Paste P1478

(An Untitled Masterwork)
ActivePublic

Authored by anlambert on Oct 4 2022, 9:21 PM.
diff --git a/swh/lister/nixguix/lister.py b/swh/lister/nixguix/lister.py
index 2623ef2..f1549e7 100644
--- a/swh/lister/nixguix/lister.py
+++ b/swh/lister/nixguix/lister.py
@@ -111,7 +111,7 @@ PageResult = Tuple[ArtifactType, Union[Artifact, VCS]]
VCS_SUPPORTED = ("git", "svn", "hg")
# Rough approximation of what we can find of mimetypes for tarballs "out there"
-POSSIBLE_TARBALL_MIMETYPES = set(MIMETYPE_TO_ARCHIVE_FORMAT.keys())
+POSSIBLE_TARBALL_MIMETYPES = tuple(MIMETYPE_TO_ARCHIVE_FORMAT.keys())
def is_tarball(urls: List[str], request: Optional[Any] = None) -> Tuple[bool, str]:
@@ -192,7 +192,7 @@ def is_tarball(urls: List[str], request: Optional[Any] = None) -> Tuple[bool, st
logger.debug("Content-Type: %s", content_type)
if content_type == "application/json":
return False, urls[0]
- return content_type in POSSIBLE_TARBALL_MIMETYPES, urls[0]
+ return content_type.startswith(POSSIBLE_TARBALL_MIMETYPES), urls[0]
raise ArtifactNatureUndetected(
f"Cannot determine artifact type from url <{url}>"