private static ClientBuilderParams addTrailersExtractor(
            ClientBuilderParams params,
            ClientOptions options,
            SerializationFormat serializationFormat) {
        if (!GrpcSerializationFormats.isGrpcWeb(serializationFormat)) {
            return params;
        }
        final ClientDecoration originalDecoration = options.decoration();
        final List<Function<? super HttpClient, ? extends HttpClient>> decorators =
                originalDecoration.decorators();

        boolean foundRetryingClient = false;
        final HttpClient noopClient = (ctx, req) -> HttpResponse.of(HttpStatus.OK);
        for (Function<? super HttpClient, ? extends HttpClient> decorator : decorators) {
            final HttpClient decorated = decorator.apply(noopClient);
            if (decorated instanceof RetryingClient) {
                foundRetryingClient = true;
                break;
            }
        }
        if (!foundRetryingClient) {
            return params;
        }

        final GrpcWebTrailersExtractor webTrailersExtractor = new GrpcWebTrailersExtractor(
                maxInboundMessageSizeBytes(options),
                GrpcSerializationFormats.isGrpcWebText(serializationFormat));
        final ClientOptionsBuilder optionsBuilder = options.toBuilder();
        optionsBuilder.clearDecorators();
        optionsBuilder.decorator(webTrailersExtractor);

        decorators.forEach(optionsBuilder::decorator);

        return params.paramsBuilder()
                     .options(optionsBuilder.build())
                     .build();
    }
Adds the {@link GrpcWebTrailersExtractor} if the specified {@link SerializationFormat} is a gRPC-Web and
{@link RetryingClient} exists in the {@link ClientDecoration}.
grpc/src/main/java/com/linecorp/armeria/internal/client/grpc/GrpcClientFactory.java