def add_header_field(self, field, value):
        if field in self._header_index:
            self.header_fields[self._header_index[field]] = (field, value)
        else:
            self._header_index[field] = len(self.header_fields)
            self.header_fields.append((field, value))