Skip to content

Commit 5878469

Browse files
committed
fix: Remove any given anchor fragment in the URL canonicalization process
Some artifactories (e.g. JFrog), return URLs ending by an anchor, e.g. to carry the source artifact hash. To make the comparison work, remove those URL fragments. Signed-off-by: Nicolas Nobelis <nicolas.nobelis@bosch.com>
1 parent bdf7ea5 commit 5878469

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/python_inspector/package_data.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,10 @@ def canonicalize_url(url: str):
129129
for url in urls:
130130
value = urls.get(url)
131131

132+
# remove the URL anchor fragment
133+
url_parsed = urlparse(url)
134+
url = urlunparse(url_parsed._replace(fragment=""))
135+
132136
if url.startswith("https"):
133137
url_sanitized = canonicalize_url(url)
134138
else:

0 commit comments

Comments
 (0)