Various fixes and improvements (#454, #1026, #1050, #1051, #1052, #1060)

This commit is contained in:
Imran Remtulla
2023-11-03 19:35:42 -04:00
parent 26971aa109
commit 5b142b4401
6 changed files with 31 additions and 22 deletions

View File

@@ -283,9 +283,6 @@ preStandardizeUrl(String url) {
url.toLowerCase().indexOf('https://') != 0) {
url = 'https://$url';
}
if (url.toLowerCase().indexOf('https://www.') == 0) {
url = 'https://${url.substring(12)}';
}
url = url
.split('/')
.where((e) => e.isNotEmpty)
@@ -599,7 +596,7 @@ class SourceProvider {
AppSource? source;
for (var s in sources.where((element) => element.host != null)) {
if (RegExp(
'://${s.allowSubDomains ? '([^\\.]+\\.)*' : ''}${s.host}(/|\\z)?')
'://(${s.allowSubDomains ? '([^\\.]+\\.)*' : ''}|www\\.)${s.host}(/|\\z)?')
.hasMatch(url)) {
source = s;
break;