Skip to content
Snippets Groups Projects
Commit e51b808d authored by Antoine Lambert's avatar Antoine Lambert
Browse files

nixguix: Ensure to not use a redirection URL as an origin URL

Redirection URLs can be long and quite obscure in some cases (GitHub CDN
for instance) so ensure to use the redirected URL as origin URL.

Related to swh/meta#5090.
parent 41407e0e
No related branches found
No related tags found
No related merge requests found
......@@ -262,9 +262,7 @@ def is_tarball(
if location: # It's not always present
logger.debug("Location: %s", location)
try:
# FIXME: location is also returned as it's considered the true
# origin, true enough?
return _is_tarball(location), location
return _is_tarball(location), url
except ArtifactWithoutExtension:
logger.warning(
"Still cannot detect extension through location <%s>...",
......
......@@ -189,7 +189,7 @@ def test_is_tarball_complex_with_location_result(
is_tar, origin = is_tarball(urls, requests)
assert is_tar == expected_result
if is_tar:
assert origin == fallback_url
assert origin == url
@pytest.mark.parametrize(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment