  void responseAction(StreamState& state,
                      const test::common::http::ResponseAction& response_action) {
    const bool end_stream = response_action.end_stream();
    switch (response_action.response_action_selector_case()) {
    case test::common::http::ResponseAction::kContinueHeaders: {
      if (state == StreamState::PendingHeaders) {
        auto headers = std::make_unique<TestResponseHeaderMapImpl>(
            Fuzz::fromHeaders<TestResponseHeaderMapImpl>(response_action.continue_headers()));
        headers->setReferenceKey(Headers::get().Status, "100");
        decoder_filter_->callbacks_->encode100ContinueHeaders(std::move(headers));
        // We don't allow multiple 100-continue headers in HCM, UpstreamRequest is responsible
        // for coalescing.
        state = StreamState::PendingNonInformationalHeaders;
      }
      break;
    }
    case test::common::http::ResponseAction::kHeaders: {
      if (state == StreamState::PendingHeaders ||
          state == StreamState::PendingNonInformationalHeaders) {
        auto headers = std::make_unique<TestResponseHeaderMapImpl>(
            Fuzz::fromHeaders<TestResponseHeaderMapImpl>(response_action.headers()));
        // The client codec will ensure we always have a valid :status.
        // Similarly, local replies should always contain this.
        uint64_t status;
        try {
          status = Utility::getResponseStatus(*headers);
        } catch (const CodecClientException&) {
          headers->setReferenceKey(Headers::get().Status, "200");
        }
        // The only 1xx header that may be provided to encodeHeaders() is a 101 upgrade,
        // guaranteed by the codec parsers. See include/envoy/http/filter.h.
        if (CodeUtility::is1xx(status) && status != enumToInt(Http::Code::SwitchingProtocols)) {
          headers->setReferenceKey(Headers::get().Status, "200");
        }
        decoder_filter_->callbacks_->encodeHeaders(std::move(headers), end_stream, "details");
        state = end_stream ? StreamState::Closed : StreamState::PendingDataOrTrailers;
      }
      break;
    }
    case test::common::http::ResponseAction::kData: {
      if (state == StreamState::PendingDataOrTrailers) {
        Buffer::OwnedImpl buf(std::string(response_action.data() % (1024 * 1024), 'a'));
        decoder_filter_->callbacks_->encodeData(buf, end_stream);
        state = end_stream ? StreamState::Closed : StreamState::PendingDataOrTrailers;
      }
      break;
    }
    case test::common::http::ResponseAction::kTrailers: {
      if (state == StreamState::PendingDataOrTrailers) {
        decoder_filter_->callbacks_->encodeTrailers(std::make_unique<TestResponseTrailerMapImpl>(
            Fuzz::fromHeaders<TestResponseTrailerMapImpl>(response_action.trailers())));
        state = StreamState::Closed;
      }
      break;
    }
    default:
      // Maybe nothing is set?
      break;
    }
  }
  void responseAction(StreamState& state,
                      const test::common::http::ResponseAction& response_action) {
    const bool end_stream = response_action.end_stream();
    switch (response_action.response_action_selector_case()) {
    case test::common::http::ResponseAction::kContinueHeaders: {
      if (state == StreamState::PendingHeaders) {
        auto headers = std::make_unique<TestResponseHeaderMapImpl>(
            Fuzz::fromHeaders<TestResponseHeaderMapImpl>(response_action.continue_headers()));
        headers->setReferenceKey(Headers::get().Status, "100");
        decoder_filter_->callbacks_->encode100ContinueHeaders(std::move(headers));
         
         
        state = StreamState::PendingNonInformationalHeaders;
      }
      break;
    }
    case test::common::http::ResponseAction::kHeaders: {
      if (state == StreamState::PendingHeaders ||
          state == StreamState::PendingNonInformationalHeaders) {
        auto headers = std::make_unique<TestResponseHeaderMapImpl>(
            Fuzz::fromHeaders<TestResponseHeaderMapImpl>(response_action.headers()));
         
         
        uint64_t status;
        try {
          status = Utility::getResponseStatus(*headers);
        } catch (const CodecClientException&) {
          headers->setReferenceKey(Headers::get().Status, "200");
        }
         
         
        if (CodeUtility::is1xx(status) && status != enumToInt(Http::Code::SwitchingProtocols)) {
          headers->setReferenceKey(Headers::get().Status, "200");
        }
        decoder_filter_->callbacks_->encodeHeaders(std::move(headers), end_stream, "details");
        state = end_stream ? StreamState::Closed : StreamState::PendingDataOrTrailers;
      }
      break;
    }
    case test::common::http::ResponseAction::kData: {
      if (state == StreamState::PendingDataOrTrailers) {
        Buffer::OwnedImpl buf(std::string(response_action.data() % (1024 * 1024), 'a'));
        decoder_filter_->callbacks_->encodeData(buf, end_stream);
        state = end_stream ? StreamState::Closed : StreamState::PendingDataOrTrailers;
      }
      break;
    }
    case test::common::http::ResponseAction::kTrailers: {
      if (state == StreamState::PendingDataOrTrailers) {
        decoder_filter_->callbacks_->encodeTrailers(std::make_unique<TestResponseTrailerMapImpl>(
            Fuzz::fromHeaders<TestResponseTrailerMapImpl>(response_action.trailers())));
        state = StreamState::Closed;
      }
      break;
    }
    default:
       
      break;
    }
  }