通过异步写入 header

def flush_headers(self, sync: bool = False) -> None:
        """
        通过异步写入 header
        """
        if self._headers_sent:
            return
        self._headers_sent = True
        self.handel_default()
        self.write(
            b"HTTP/%s %d %s\r\n" % (
                encode_str(self._version),
                self._status,
                self._message,
            ),
            sync,
        )
        for name, value in self._headers.items():
            name_byte = encode_str(name)
            if isinstance(value, list):
                for val in value:
                    self.write(
                        b"%s: %s\r\n" % (
                            name_byte,
                            encode_str(val),
                        ),
                        sync,
                    )
            else:
                val = value
                self.write(
                    b"%s: %s\r\n" % (
                        name_byte,
                        encode_str(value),
                    ),
                    sync,
                )
        self.write(b"\r\n", sync)