/*
It is the main entry point to check using fullurl including query
776251
public function checkQuery($fullUrlWithQuery,$active=null,$inactive=null)
    {
        $this->setReturnValue($active,$inactive);

        if (is_array($fullUrlWithQuery)) {
            $result = call_user_func_array(array($this,'queryIsDeeply'), $fullUrlWithQuery);
        } else {
            $result = $this->queryIsDeeply($fullUrlWithQuery);   
        }

        return $result ? $this->activeValue : $this->inActiveValue;
    }
134025
public function buildComplete($url = null, $full = false) {
		if (is_array($url)) {
			$url = $this->addQueryStrings($url);
		}

		return parent::build($url, $full);
	}
515152
private String getFullUrl(String url) {
        return url.startsWith("https://") || url.startsWith("http://") ? url : transloadit.getHostUrl() + url;
    }
1292479
public static function fullUrl()
    {
        $s        = empty($_SERVER["HTTPS"]) ? '' : ($_SERVER["HTTPS"] == "on") ? "s" : "";
        $protocol = StringUtils::strLeft(strtolower($_SERVER["SERVER_PROTOCOL"]), "/").$s;
        $port     = ($_SERVER["SERVER_PORT"] == "80" || $_SERVER["SERVER_PORT"] == "443") ? "" : (":".$_SERVER["SERVER_PORT"]);
        $uri      = (isset($_SERVER['REQUEST_URI'])?$_SERVER['REQUEST_URI']:"");
        return $protocol."://".$_SERVER['SERVER_NAME'].$port.$uri;
    }
1182
public static function fullUrl($url = '', $echo = true)
    {
        $url = Request::baseUrl() . self::url($url, false);
        if ($echo) {
            echo $url;
            return '';
        } else {
            return $url;
        }
    }
45980
function checkBaseURL(href) {
        var el = document.createElement('div'),
        escapedURL = href.split('&').join('&amp;').
            split('<').join('&lt;').
            split('"').join('&quot;');

        el.innerHTML = '<a href="' + escapedURL + '">x</a>';
        return el.firstChild.href;
	}
697244
static function get_url_and_save($fully_qualified_url, $filename)
    {
        // strange 400 errors can occur if we don't check to make sure our URL is trimmed up.
        $fully_qualified_url = trim($fully_qualified_url);
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $fully_qualified_url);
        curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)');
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
        $output = curl_exec($ch);
        $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
        $httpdebug = curl_getinfo($ch);
        if ($httpcode == 200) {
            self::create_file($filename, $output);
            echo("Saved file: ".$filename.PHP_EOL);
        } else {
            echo ('error.  http debug: '.var_export($httpdebug, true).PHP_EOL);
        }
        curl_close($ch);
    }
1182199
public static String getRequestURL(HttpServletRequest req, boolean includeQueryString) {

	StringBuffer sb = req.getRequestURL();
	int maxpos = sb.indexOf("/", 8);

	if (maxpos > -1) {

	    if (req.isSecure()) {
		if (sb.substring(maxpos - 4, maxpos).equals(":443")) sb.delete(maxpos - 4, maxpos);
	    }
	    else {
		if (sb.substring(maxpos - 3, maxpos).equals(":80")) sb.delete(maxpos - 3, maxpos);
	    }

	    if (includeQueryString && !StringUtil.isEmpty(req.getQueryString())) sb.append('?').append(req.getQueryString());
	}

	return sb.toString();
    }
414870
public function fullUrlWithQuery( array $query )
	{
		return count( $this->query() ) > 0 ? $this->url() . '/?' . http_build_query( array_merge( $this->query(), $query ) ) : $this->fullUrl() . '?' . http_build_query( $query );
	}
1030702
function checkUriRaw(i) {
  const start = i;
  let l;

  while (i < tokensLength) {
    if (checkInterpolation(i) || checkVariable(i)) break;
    else if (l = checkUriRawCharacters(i)) i += l;
    else break;
  }

  tokens[start].uri_raw_end = i;

  return i - start;
}
100861
function _isCurrentUrl(href, currentUrl) {
        if (!currentUrl) {
            return false;
        }

        var strippedHref = href.replace(/\/+$/, ''),
            strippedCurrentUrl = currentUrl.replace(/\/+$/, '');
        return strippedHref === strippedCurrentUrl;
    }
240534
function Query(server, query, options, token) {
  this.server = server;
  this.query = query;
  // Used to track the presence of r.args (workaround)
  this.originalQuery = util.deepCopy(query);
  this.options = {};
  this.context = {};
  this.frames = [];
  this.nowValue = ReqlDate.now();
  this.complete = false;
  this.token = token;

}
1154129
function fullUrl(path) {
  const urlPort = port === 80 ? '' : ':' + port;
  const urlPublicUrl = publicUrl;
  const urlBaseUrl = baseUrl;
  return `${urlPublicUrl}${urlPort}${urlBaseUrl}${path}`;
}
383076
function URLHelper(baseUrl) {
    var _this3 = this;

    _classCallCheck(this, URLHelper);

    _defineProperty(this, "baseUrl", '');

    _defineProperty(this, "search", {});

    var t = decodeURI(baseUrl).split('?');
    this.baseUrl = t[0];

    if (t[1]) {
      t[1].split('&').forEach(function (v) {
        var t2 = v.split('=');
        _this3.search[t2[0]] = t2[1] == null ? '' : decodeURIComponent(t2[1]);
      });
    }
  }
940790
function(query) {
        var url;

        if (query && query.users().length) {
            // When one or more users are specified, use the global images endpoint
            url = this.getResourceUrl({
                path: '/images',
                user: null
            });
        } else {
            url = this.getUserUrl();
            url.setPath(url.getPath() + '/images');
        }

        if (query) {
            url.setQueryString(query.toString());
        }

        return url;
    }
945267
function queryChecker(checkQuery) {
  if (!checkQuery) {
    throw new Error('check query can not be null');
  }
  debug('query checker conditions:%s', checkQuery);
  const arr = checkQuery.split('&');
  const checkParams = {};
  const checkKeys = [];
  arr.forEach((str) => {
    const tmpArr = str.split('=');
    const key = tmpArr[0];
    checkKeys.push(key);
    checkParams[key] = tmpArr[1];
  });

  return (ctx, next) => {
    const query = ctx.query;
    debug('query:%j', query);
    let valid = true;
    checkKeys.forEach((key) => {
      if (valid && query[key] !== checkParams[key]) {
        valid = false;
      }
    });

    if (valid) {
      return next();
    }
    const originalUrl = ctx.originalUrl;
    const urlInfo = url.parse(originalUrl);
    checkKeys.forEach((key) => {
      query[key] = checkParams[key];
    });
    /* eslint no-param-reassign:0 */
    ctx.status = 302;
    ctx.set('Cache-Control', 'no-cache, no-store, max-age=0');
    ctx.redirect(`${urlInfo.pathname}?${qs.stringify(query)}`);
    return null;
  };
}
605773
function compareUrlRoute(currentURL, currentRoute) {
                var regex = /\{(.*)\}/i;
                var arraySize = currentRoute.length,
                    testValue = false;
                for (var i = 0; i < arraySize; i++) {
                    var dynamic = regex.exec(currentRoute[i]);
                    if (dynamic) {
                        document.routeParams[dynamic[1]] = currentURL[i];
                    } else {
                        if (currentRoute[i] === currentURL[i]) {
                            testValue = true;
                        }
                    }
                }

                return testValue;
            }