spring-projects / spring-security

Spring Security
http://spring.io/projects/spring-security
Apache License 2.0
8.74k stars 5.86k forks source link

RestClient : interceptors are executed 2 times #14520

Closed rawadolb closed 7 months ago

rawadolb commented 8 months ago

Describe the bug When RestCient is initialized by a RestTemplate using RestClient.builder(restTemplate) the interceptors are executed 2 times.

To Reproduce Create a RestTemplate with an interceptor (loggingInterceptor to make it simple). Initialize a RestClient and then perform a call restClient.get().uri(uri).retrieve().body(YourObject.class) LoggingInterceptor will be executed 2 times because 2 ClientHttpRequestInterceptor object are created. (Please find attached)

Expected behavior The interceptor must be executed once

RestClient

marcusdacoregio commented 7 months ago

Hi, @rawadolb. RestClient is from Spring Framework and not from Spring Security, you will find better support by opening an issue in their issue tracker.