INNER CODE UNIT · Python

get_http_host

ab77/netflix-proxy · auth/auth.py:125

def get_http_host():
    return web.ctx.environ['HTTP_HOST'].split(':')[0] or 'localhost'


def is_redirected():
    ipaddr = get_server_external_ip()
    fqdn = get_server_public_fqdn()
    http_host = get_http_host()
    if http_host == ipaddr or http_host == fqdn:
        return False
    else:
        return True
    

def csrf_token():
    if not 'csrf_token' in session:
        from uuid import uuid4
        session.csrf_token = uuid4().hex

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…