'Removes the specified header.
If a value is provided, the name and
value must match to remove the header.
If the value is None, removes all headers
with that name.'

def remove_header(self, name, value=None):

    found_it = 0
    if ((name in self.reply_headers) and ((value is None) or (self.reply_headers[name] == value))):
        del self.reply_headers[name]
        found_it = 1
    removed_headers = []
    if (not (value is None)):
        if ((name, value) in self.__reply_header_list):
            removed_headers = [(name, value)]
            found_it = 1
    else:
        for h in self.__reply_header_list:
            if (h[0] == name):
                removed_headers.append(h)
                found_it = 1
    if (not found_it):
        if (value is None):
            search_value = ('%s' % name)
        else:
            search_value = ('%s:    %s' % (name, value))
        raise LookupError(("Header    '%s'    not    found" % search_value))
    for h in removed_headers:
        self.__reply_header_list.remove(h)
