From 0e14e17236511e7abb1f98c21ebc612065aed71b Mon Sep 17 00:00:00 2001 From: Imran Remtulla Date: Fri, 1 Nov 2024 13:07:45 -0400 Subject: [PATCH] F-Droid URL parsing bugfix (#1933) --- lib/app_sources/fdroid.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/app_sources/fdroid.dart b/lib/app_sources/fdroid.dart index 22d3791..25c7175 100644 --- a/lib/app_sources/fdroid.dart +++ b/lib/app_sources/fdroid.dart @@ -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/+[^/]+',