'Returns a copy of the request object with fixed ``auth_path/params``
attributes from the original.'

def mangle_path_and_params(self, req):

    modified_req = copy.copy(req)
    parsed_path = urllib.parse.urlparse(modified_req.auth_path)
    modified_req.auth_path = parsed_path.path
    if (modified_req.params is None):
        modified_req.params = {}
    else:
        copy_params = req.params.copy()
        modified_req.params = copy_params
    raw_qs = parsed_path.query
    existing_qs = parse_qs_safe(raw_qs, keep_blank_values=True)
    for (key, value) in existing_qs.items():
        if isinstance(value, (list, tuple)):
            if (len(value) == 1):
                existing_qs[key] = value[0]
    modified_req.params.update(existing_qs)
    return modified_req
