Skip to content

Commit 04e5d4c

Browse files
committed
fix: ensure credit contact links are absolute
1 parent 249cd18 commit 04e5d4c

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

scripts/generate_osv_advisories.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import tomllib
1313
import typing
1414
from datetime import UTC, datetime
15+
from urllib.parse import urljoin
1516

1617
import requests
1718
import semver
@@ -312,6 +313,10 @@ def get_credits_from_sa(
312313
if '<a' in credit:
313314
href = credit.split('href="')[1].split('"')[0]
314315
name = credit.split('">')[1].split('</a>')[0]
316+
317+
# ensure the contact link is absolute
318+
href = urljoin('https://www.drupal.org', href)
319+
315320
credit_list.append({'name': name.strip(), 'contact': [href]})
316321

317322
return sorted(credit_list, key=lambda c: c['name'])

0 commit comments

Comments
 (0)