Skip to content

Commit f3b5164

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 74bb4f0 commit f3b5164

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/python_inspector/package_data.py

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

115+
# remove the URL anchor fragment
116+
url_parsed = urlparse(url)
117+
url = urlunparse(url_parsed._replace(fragment=""))
118+
115119
if url.startswith("https"):
116120
url_sanitized = canonicalize_url(url)
117121
else:

0 commit comments

Comments
 (0)