def request_host(request):
    url = request.get_full_url()
    host = urlparse.urlparse(url)[1]
    if host == "":
        host = request.get_header("Host", "")

    # remove port, if present
    host = _cut_port_re.sub("", host, 1)
    return host.lower()
Return request-host, as defined by RFC 2965.
dataset/ETHPy150Open babble/babble/include/jython/Lib/urllib2.py/request_host