There was an error while loading. Please reload this page.
1 parent 442bc5b commit 2f0a048Copy full SHA for 2f0a048
1 file changed
src/go_inspector/utils.py
@@ -30,10 +30,10 @@ def repository_homepage_url(purl):
30
31
def get_vcs_segments(purl):
32
nsname = get_nsname(purl)
33
- if nsname.startswith(("github", "gitlab")):
+ if nsname.startswith(("github.com", "gitlab.com")):
34
segments = nsname.strip("/").split("/")
35
if len(segments) >= 3:
36
- typ = segments[0]
+ typ, _, _ = segments[0].partition(".")
37
ns = segments[1]
38
nm = segments[2]
39
return typ, ns, nm
@@ -59,8 +59,6 @@ def source_purl(purl):
59
tnsn = get_vcs_segments(purl)
60
if tnsn:
61
typ, ns, nm = tnsn
62
- # strip trailing .com from github.com
63
- typ, _, _ = typ.partition(".")
64
vrs = purl.version
65
# only use commit for pseudo semver versions
66
if vrs and (commit := extract_commit(vrs)):
0 commit comments