F-Droid URL parsing bugfix (#1933)

This commit is contained in:
Imran Remtulla
2024-11-01 13:07:45 -04:00
parent fc541837ef
commit 0e14e17236

View File

@ -45,7 +45,7 @@ class FDroid extends AppSource {
RegExpMatch? match = standardUrlRegExB.firstMatch(url);
if (match != null) {
url =
'https://${Uri.parse(match.group(0)!).host}/packages/${Uri.parse(url).pathSegments.last}';
'https://${Uri.parse(match.group(0)!).host}/packages/${Uri.parse(url).pathSegments.where((s) => s.trim().isNotEmpty).last}';
}
RegExp standardUrlRegExA = RegExp(
'^https?://(www\\.)?${getSourceRegex(hosts)}/+packages/+[^/]+',