docs: def fetch_challenge(http_header):
    """ apparently keywords Basic and Digest are not being checked 
    anywhere and decisions are being made based on authorization 
    configuration of client, so I guess you better know what you are
    doing.  Here I am requiring one or the other be specified.
  
        challenge Basic auth_param
        challenge Digest auth_param
    """
    m = fetch_challenge.wwwauth_header_re.match(http_header)
    if m is None:
        raise RuntimeError, 'expecting "WWW-Authenticate header [Basic,Digest]"'
  
    d = dict(challenge=m.groups()[0])
    m = fetch_challenge.auth_param_re.search(http_header)
    while m is not None:
        k,v = http_header[m.start():m.end()].split('=')
        d[k.lower()] = v[1:-1]
        m = fetch_challenge.auth_param_re.search(http_header, m.end())
         
    return d