def _receive_headers_frame(self, frame):
        # If necessary, check we can open the stream. Also validate that the
        # stream ID is valid.
        if frame.stream_id not in self.streams:
            max_open_streams = self.local_settings.max_concurrent_streams
            if (self.open_inbound_streams + 1) > max_open_streams:
                raise TooManyStreamsError(
                    "Max outbound streams is %d, %d open" %
                    (max_open_streams, self.open_outbound_streams)
                )

        # Let's decode the headers. We handle headers as bytes internally up
        # until we hang them off the event, at which point we may optionally
        # convert them to unicode.
        try:
            headers = self.decoder.decode(frame.data, raw=True)
        except (HPACKError, IndexError, TypeError, UnicodeDecodeError) as e:
            # We should only need HPACKError here, but versions of HPACK
            # older than 2.1.0 throw all three others as well. For maximum
            # compatibility, catch all of them.
            raise ProtocolError("Error decoding header block: %s" % e)

        headers = validate_headers(headers)
        events = self.state_machine.process_input(
            ConnectionInputs.RECV_HEADERS
        )
        stream = self._get_or_create_stream(
            frame.stream_id, AllowedStreamIDs(not self.client_side)
        )
        frames, stream_events = stream.receive_headers(
            headers,
            'END_STREAM' in frame.flags,
            self.header_encoding
        )

        if 'PRIORITY' in frame.flags:
            p_frames, p_events = self._receive_priority_frame(frame)
            stream_events.extend(p_events)
            assert not p_frames

        return frames, events + stream_events
Test  if the server doesn't reply to an unknown command
dataset/ETHPy150Open python-hyper/hyper-h2/h2/connection.py/H2Connection._receive_headers_frame--crossover with--dataset/ETHPy150Open ebu/radiodns-plugit/RadioVisServer/tests.py/MainTests.test_stomp_randomcommand