code: private void sendResponseHeaders(ChannelHandlerContext ctx, SendResponseHeadersCommand cmd,
        ChannelPromise promise) throws Http2Exception {
      // TODO(carl-mastrangelo): remove this check once https://github.com/netty/netty/issues/6296 is
      // fixed.
      int streamId = cmd.stream().id();
      Http2Stream stream = connection().stream(streamId);
      if (stream == null) {
        resetStream(ctx, streamId, Http2Error.CANCEL.code(), promise);
        return;
      }
      if (cmd.endOfStream()) {
        closeStreamWhenDone(promise, streamId);
      }
      encoder().writeHeaders(ctx, streamId, cmd.headers(), 0, cmd.endOfStream(), promise);
    }
docs: Sends the response headers to the client.