Don't clobber rest template interceptors

This commit is contained in:
Dave Syer
2016-01-08 12:05:45 +00:00
parent cd7fbd617d
commit 55bdda9cb1
2 changed files with 3 additions and 2 deletions

View File

@@ -56,7 +56,8 @@ public class LoadBalancerAutoConfiguration {
return new RestTemplateCustomizer() {
@Override
public void customize(RestTemplate restTemplate) {
List<ClientHttpRequestInterceptor> list = new ArrayList<>();
List<ClientHttpRequestInterceptor> list = new ArrayList<>(
restTemplate.getInterceptors());
list.add(loadBalancerInterceptor);
restTemplate.setInterceptors(list);
}

View File

@@ -6,5 +6,5 @@ import org.springframework.web.client.RestTemplate;
* @author Spencer Gibb
*/
public interface RestTemplateCustomizer {
void customize(RestTemplate restTemplate);
void customize(RestTemplate restTemplate);
}