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); RegExpMatch? match = standardUrlRegExB.firstMatch(url);
if (match != null) { if (match != null) {
url = 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( RegExp standardUrlRegExA = RegExp(
'^https?://(www\\.)?${getSourceRegex(hosts)}/+packages/+[^/]+', '^https?://(www\\.)?${getSourceRegex(hosts)}/+packages/+[^/]+',