MCPcopy Create free account
hub / github.com/M66B/FairEmail / fix

Method fix

app/src/main/java/eu/faircode/email/UriHelper.java:629–639  ·  view source on GitHub ↗
(Uri uri)

Source from the content-addressed store, hash-verified

627 }
628
629 static Uri fix(Uri uri) {
630 if ((!"http".equals(uri.getScheme()) && "http".equalsIgnoreCase(uri.getScheme())) ||
631 (!"https".equals(uri.getScheme()) && "https".equalsIgnoreCase(uri.getScheme()))) {
632 String u = uri.toString();
633 int semi = u.indexOf(':');
634 if (semi > 0)
635 return Uri.parse(u.substring(0, semi).toLowerCase(Locale.ROOT) + u.substring(semi));
636 }
637
638 return uri;
639 }
640
641 static String getHost(Uri uri) {
642 if ("mailto".equalsIgnoreCase(uri.getScheme())) {

Callers 4

onExecuteMethod · 0.95
onClickMethod · 0.95
viewMethod · 0.95
onOpenLinkMethod · 0.95

Calls 4

indexOfMethod · 0.80
equalsMethod · 0.45
toStringMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected