'Turn Authorization: header into parameters.'

def _split_header(header):

    params = {}
    parts = header.split(',')
    for param in parts:
        if (param.find('realm') > (-1)):
            continue
        param = param.strip()
        param_parts = param.split('=', 1)
        params[param_parts[0]] = urllib.unquote(param_parts[1].strip('"'))
    return params
