diff --git a/lib/providers/source_provider.dart b/lib/providers/source_provider.dart index 2c55e00..249111c 100644 --- a/lib/providers/source_provider.dart +++ b/lib/providers/source_provider.dart @@ -734,11 +734,15 @@ class SourceProvider { } AppSource? source; for (var s in sources.where((element) => element.hosts.isNotEmpty)) { - if (RegExp( - '://${s.allowSubDomains ? '([^\\.]+\\.)*' : '(www\\.)?'}(${getSourceRegex(s.hosts)})(/|\\z)?') - .hasMatch(url)) { - source = s; - break; + try { + if (RegExp( + '^${s.allowSubDomains ? '([^\\.]+\\.)*' : '(www\\.)?'}(${getSourceRegex(s.hosts)})\$') + .hasMatch(Uri.parse(url).host)) { + source = s; + break; + } + } catch (e) { + // Ignore } } if (source == null) {