This method checks by configured whitelist, if the url is in the list of allowed urls without a
referer in the header
@param url
@returns {boolean}
541966
function filterByUrls(url) {
        if(_config.refererIndependentUrls) {
            var isRefererIndependend = false;
            for(var i in _config.refererIndependentUrls) {
                if(new RegExp(_config.refererIndependentUrls[i]).test(url.split('?')[0])) {
                    isRefererIndependend = true;
                    break;
                }
            }
            return isRefererIndependend;
        } else {
            return url === '/';
        }
    }
1205974
public function checkWhitelist(string $url): bool
	{
		$pluginSettings = EmbeddedAssets::$plugin->getSettings();
		$whitelist = array_merge($pluginSettings->whitelist, $pluginSettings->extraWhitelist);

		foreach ($whitelist as $whitelistUrl)
		{
			if ($whitelistUrl)
			{
				$pattern = explode('*', $whitelistUrl);
				$pattern = array_map('preg_quote', $pattern);
				$pattern = implode('[a-z][a-z0-9]*', $pattern);
				$pattern = "%^(https?:)?//([a-z0-9\-]+\\.)?$pattern([:/].*)?$%";

				if (preg_match($pattern, $url))
				{
					return true;
				}
			}
		}

		return false;
	}
647243
function isAnchor(href) {
    try {
        var parsed = url.parse(href);
        return !!(!parsed.protocol && !parsed.path && parsed.hash);
    } catch(err) {
        return false;
    }
}
233678
function isProxyForURL(noProxy, address) {
    // wildcard
    if (noProxy === '*') {
        return (null);
    }

    // otherwise, parse the noProxy value to see if it applies to the URL
    if (noProxy !== null) {
        var noProxyItem, hostname, port, noProxyItemParts,
            noProxyHost, noProxyPort, noProxyList;

        // canonicalize the hostname
        /* JSSTYLED */
        hostname = address.hostname.replace(/^\.*/, '.').toLowerCase();
        noProxyList = noProxy.split(',');

        for (var i = 0, len = noProxyList.length; i < len; i++) {
            noProxyItem = noProxyList[i].trim().toLowerCase();

            // no_proxy can be granular at the port level
            if (noProxyItem.indexOf(':') > -1) {
                noProxyItemParts = noProxyItem.split(':', 2);
                /* JSSTYLED */
                noProxyHost = noProxyItemParts[0].replace(/^\.*/, '.');
                noProxyPort = noProxyItemParts[1];
                port = address.port ||
                    (address.protocol === 'https:' ? '443' : '80');

                // match - ports are same and host ends with no_proxy entry.
                if (port === noProxyPort &&
                    hostname.indexOf(noProxyHost) ===
                    hostname.length - noProxyHost.length) {
                    return (null);
                }
            } else {
                /* JSSTYLED */
                noProxyItem = noProxyItem.replace(/^\.*/, '.');
                var isMatchedAt = hostname.indexOf(noProxyItem);

                if (isMatchedAt > -1 &&
                    isMatchedAt === hostname.length - noProxyItem.length) {
                    return (null);
                }
            }
        }
    }
    return (true);
}
175570
protected boolean isAvailable(URL url) {

        try (InputStream inputStream = url.openStream()) {
            return true;
        } catch (IOException e) { //NOSONAR
            LOG.debug("URL {} not available", url, e);
            return false;
        }
    }
567995
def url_is(white_list):
    
    def func(url):
        prefixes = white_list.get('PREFIXES', ())
        for prefix in prefixes:
            if url.startswith(prefix):
                return True
        constants = white_list.get('CONSTANTS', ())
        for exact_url in constants:
            if url == exact_url:
                return True
        return False
    return func
1157530
def is_whitelisted(self, request: AxesHttpRequest, credentials: dict = None) -> bool:  # pylint: disable=unused-argument
        

        if is_client_ip_address_whitelisted(request):
            return True

        if is_client_method_whitelisted(request):
            return True

        return False
1244096
function validateUrl(url) {
        var validate = appOptions.validate,
            type = Object.prototype.toString.call(validate);

        if (type === "[object RegExp]") {
            return validate.test(url);
        } else if (type === "[object Function]") {
            return validate(url);
        } else {
            return true;
        }
    }
1144631
function(url) {
			var paths = this.paths;
			for(var index = 0; index < paths.length; index++) {
				var path = paths[index];
				if (path === url.substring(0, path.length)) {
					return url.substring(path.length);
				}
			}
			return url;
		}
177613
private boolean isInvalidURL(String url) {
        try {
            final URL u = new URL(url);
            u.toURI();
        } catch (MalformedURLException | URISyntaxException e) {
            LOGGER.trace("URL is invalid: {}", url);
            return true;
        }
        return false;
    }
717977
public function isWhitelisted($uri, array $whitelistUrls = null)
    {
        if (is_null($whitelistUrls)) {
            $whitelistUrls = $this->whitelistedUrls;
        }
        foreach ($whitelistUrls as $whitelistUrl) {
            $match = preg_match('`'.$whitelistUrl.'`i', $uri);

            if ($match > 0) {
                return true;
            }
        }

        return false;
    }
599263
protected boolean excluded(String url) {
        for (final Pattern urlPattern : this.excludedUrls) {
            final Matcher matcher = urlPattern.matcher(url);
            if (matcher.matches()) {
                if (this.logger.isDebugEnabled()) {
                    this.logger.debug("Exclude pattern " + urlPattern.pattern() + " matches " + url);
                }
                return true;
            }
        }
        
        return false;
    }
266634
function isBlacklisted(ip, callback) {
    var host_lookup = reverseIp(ip) + bl_zones[current_bl];

    dns.resolve4(host_lookup, function(err, domain) {
        if (err) {
            // Not blacklisted
            callback(false);
        } else {
            // It is blacklisted
            callback(true);
        }
    });
}
54982
def _IsValidUrl(self, url):
    
    parsed_url = urlparse.urlparse(url)
    return parsed_url.scheme in self._SUPPORTED_URL_SCHEMES
62080
function isLocalURL( aURL ) {

    // check if the URL belongs to an asset on the same domain the application is running on

    if ( aURL.substr( 0, 2 ) === "./" ||
        aURL.indexOf( window.location.protocol + "//" + window.location.host ) === 0 ) {
        return true;
    }

    // check if given URL is a http(s) URL, if so we know it is not local

    let urlRoot = ( aURL.split( "#" )[ 0 ] ).split( "?" )[ 0 ];

    // .html-file in the path name ? strip it

    if ( urlRoot.indexOf( ".html" ) > -1 ) {

        const urlArr    = urlRoot.split( "/" );
        const arrLength = urlArr.length;
        urlRoot = urlRoot.split( urlArr[ arrLength - 1 ]).join( "" );
    }

    if ( urlRoot ) {
        const match = urlRoot.match( /^http[s]?:/ );
        if ( Array.isArray( match ) && match.length > 0 ) {
            return false;
        }
    }

    // at this point we know we're likely dealing with a data URL, which is local

    return true;
}
1103150
public static boolean containsURL(final URL[] urls, final URL url) {
        checkNotNull("urls", urls);
        checkNotNull("url", url);
        for (int i = 0; i < urls.length; i++) {
            final URL element = urls[i];
            final String elementStr = element.toExternalForm();
            final String urlStr = url.toExternalForm();
            if (elementStr.equals(urlStr)) {
                return true;
            }
        }
        return false;
    }
302221
function isInTrustyOrigins(url, trustyOrigins) {
  const len = trustyOrigins.length;
  for (let i = 0; i < len; i++) {
    if (trustyOrigins[i] === '*') {
      return true;
    }
    if (isSameOrigin(trustyOrigins[i], url)) {
      return true;
    }
  }
  return false;
}