Code review comment: At the moment the filter instance is created per call. I plan to create a new PR with performance improvements, such as caching web targets, and reusing filters. I will cache the header container proxy in it.

Code under review:
public void filter(ClientRequestContext requestContext) {
        
        MultivaluedMap<String, String> headers = new MultivaluedHashMap<>();

        
        requestContext.getHeaders().forEach(
                (key, values) -> headers.put(key, castToListOfStrings(values)));

        
        if (headerFiller != null) {
            
            headerFiller.addHeaders(headers);
        }

        MultivaluedMap<String, String> incomingHeaders = MicroProfileRestRequestClientFilter.EMPTY_MAP;
        if (Arc.container().getActiveContext(RequestScoped.class) != null) {
            HeaderContainer headerContainer = Arc.container().instance(HeaderContainer.class).get();
            if (headerContainer != null) {
                incomingHeaders = headerContainer.getHeaders();
            }
        }

        if (headersFactory instanceof DefaultClientHeadersFactoryImpl) {
            
            
            headers.forEach((key, values) -> requestContext.getHeaders().put(key, castToListOfObjects(values)));
        }
        headersFactory.update(incomingHeaders, headers)
                .forEach((key, values) -> requestContext.getHeaders().put(key, castToListOfObjects(values)));

        requestContext.setProperty("org.eclipse.microprofile.rest.client.invokedMethod", method);
    }

Line commented on: incomingHeaders = headerContainer.getHeaders();

Revised code:
public void filter(ClientRequestContext requestContext) {
        
        MultivaluedMap<String, String> headers = new MultivaluedHashMap<>();

        
        for (Map.Entry<String, List<Object>> headerEntry : requestContext.getHeaders().entrySet()) {
            headers.put(headerEntry.getKey(), castToListOfStrings(headerEntry.getValue()));
        }

        
        if (headerFiller != null) {
            
            headerFiller.addHeaders(headers);
        }

        MultivaluedMap<String, String> incomingHeaders = MicroProfileRestRequestClientFilter.EMPTY_MAP;
        if (Arc.container().getActiveContext(RequestScoped.class) != null) {
            HeaderContainer headerContainer = Arc.container().instance(HeaderContainer.class).get();
            if (headerContainer != null) {
                incomingHeaders = headerContainer.getHeaders();
            }
        }

        if (headersFactory instanceof DefaultClientHeadersFactoryImpl) {
            
            
            for (Map.Entry<String, List<String>> headerEntry : headers.entrySet()) {
                requestContext.getHeaders().put(headerEntry.getKey(), castToListOfObjects(headerEntry.getValue()));
            }
        }

        MultivaluedMap<String, String> updatedHeaders = headersFactory.update(incomingHeaders, headers);

        for (Map.Entry<String, List<String>> headerEntry : updatedHeaders.entrySet()) {
            requestContext.getHeaders().put(headerEntry.getKey(), castToListOfObjects(headerEntry.getValue()));
        }

        requestContext.setProperty("org.eclipse.microprofile.rest.client.invokedMethod", method);
    }