Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Paste
P1478
(An Untitled Masterwork)
Active
Public
Actions
Authored by
anlambert
on Oct 4 2022, 9:21 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Subscribers
None
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}>"
Event Timeline
anlambert
created this paste.
Oct 4 2022, 9:21 PM
2022-10-04 21:21:25 (UTC+2)
Log In to Comment