Add www support back to APKMirror (#1114)

This commit is contained in:
Imran Remtulla
2023-11-24 19:12:42 -05:00
parent 756763fcbe
commit 1a4ec3f049
2 changed files with 3 additions and 2 deletions

View File

@@ -32,7 +32,8 @@ class APKMirror extends AppSource {
@override
String sourceSpecificStandardizeURL(String url) {
RegExp standardUrlRegEx = RegExp('^https?://$host/apk/[^/]+/[^/]+');
RegExp standardUrlRegEx =
RegExp('^https?://(www\\.)?$host/apk/[^/]+/[^/]+');
RegExpMatch? match = standardUrlRegEx.firstMatch(url.toLowerCase());
if (match == null) {
throw InvalidURLError(name);

View File

@@ -596,7 +596,7 @@ class SourceProvider {
AppSource? source;
for (var s in sources.where((element) => element.host != null)) {
if (RegExp(
'://(${s.allowSubDomains ? '([^\\.]+\\.)*' : ''}|www\\.)${s.host}(/|\\z)?')
'://${s.allowSubDomains ? '([^\\.]+\\.)*' : '(www\\.)?'}${s.host}(/|\\z)?')
.hasMatch(url)) {
source = s;
break;