I am using ExchangeFilterFunction.ofResponseProcessor method to transform the Response received by the WebClient.

  1. Add new Headers to response
  2. Modify the response Body

ExchangeFilterFunction.ofResponseProcessor(clientResponse -> Mono.just( clientResponse .mutate() .body("This got modified") .header("example-header", "EXAMPLE-HEADER") .build()) );

I am triggering the WebClient through a Postman Call and That will call.
WebClient webClient = WebClient.builder() .filter(WebClientFilters.modifyResponseHeaders()) .clientConnector(new ReactorClientHttpConnector(httpClient)) .build();

return webClient.get() .uri("http://localhost:8080/hello-annotated") .retrieve() .bodyToMono(String.class);

But When I see the Response Headers received back at Postman I can’t see the newly added Headers via the Filter Function.
Postman Headers

But I can clearly see the Response Body has Transformed as expected.
What is causing the issue for custom headers not getting propagated back to client?

I tried with mutate method as well as from methd of ClientResponse class. But got the same issue.