checkTrueURL static method

String checkTrueURL(
  1. String url
)

Implementation

static String checkTrueURL(String url) {
  if (url.contains("https://") == false) {
    if (url.contains("https:/")) {
      var urlnew = url.replaceAll("https:/", "https://");
      return urlnew;
    } else {
      if (url.contains("http://")) {
        return url;
      } else {
        if (url.contains("http:/")) {
          var urlnew = url.replaceAll("http:/", "http://");
          return urlnew;
        } else {
          return url;
        }
      }
    }
  } else {
    return url;
  }
}