add https/http check to custom invidious host

This commit is contained in:
Christian Schneppe 2021-01-08 16:31:53 +01:00
parent 40b783a470
commit ee24656463

View file

@ -148,7 +148,10 @@ public class MyLinkify {
}
private static boolean isValid(String url) {
String urlstring = "https://" + url;
String urlstring = url;
if (!urlstring.toLowerCase(Locale.US).startsWith("http://") && !urlstring.toLowerCase(Locale.US).startsWith("https://")) {
urlstring = "https://" + url;
}
try {
return URLUtil.isValidUrl(urlstring) && Patterns.WEB_URL.matcher(urlstring).matches();
} catch (Exception e) {