'Update the session headers with the request ones while ignoring
certain name prefixes.
:type request_headers: dict'

def update_headers(self, request_headers):

    for (name, value) in request_headers.items():
        if (value is None):
            continue
        value = value.decode('utf8')
        if ((name == 'User-Agent') and value.startswith('HTTPie/')):
            continue
        for prefix in SESSION_IGNORED_HEADER_PREFIXES:
            if name.lower().startswith(prefix.lower()):
                break
        else:
            self['headers'][name] = value
