'Delete all occurrences of a specific header, if it is present.'

def __delitem__(self, name):

    name = name.lower()
    if (not (name in self.dict)):
        return
    del self.dict[name]
    name = (name + ':')
    n = len(name)
    lst = []
    hit = 0
    for i in range(len(self.headers)):
        line = self.headers[i]
        if (line[:n].lower() == name):
            hit = 1
        elif (not line[:1].isspace()):
            hit = 0
        if hit:
            lst.append(i)
    for i in reversed(lst):
        del self.headers[i]
