Skip to content

Commit 923f60d

Browse files
authored
Merge pull request #3801 from amvanbaren/fix-url-substring-sanitization
parse url to resolve CodeQL #3
2 parents 1731118 + 446f3fc commit 923f60d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

reports/get_availability_data.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import os
1010
import calendar
1111
import time
12+
from urllib.parse import urlparse
1213

1314
API_URL = 'https://betteruptime.com/api/v2'
1415
TOKEN = os.getenv('TOKEN')
@@ -43,7 +44,8 @@ def get_all_monitors():
4344
while not done:
4445
json_results = make_api_call(all_monitors_url)
4546
for monitor in json_results['data']:
46-
if 'https://open-vsx.org' in monitor['attributes']['url']:
47+
hostname = urlparse(monitor['attributes']['url']).hostname
48+
if hostname == 'open-vsx.org':
4749
all_openvsx_monitors.append(monitor)
4850
next_page = json_results['pagination'].get('next')
4951
if next_page is None:

0 commit comments

Comments
 (0)