From 4f39edc9059bf3896e996224003599261412c004 Mon Sep 17 00:00:00 2001 From: Arjen Poutsma Date: Wed, 21 Jun 2017 15:48:48 +0200 Subject: [PATCH] Fix initialization issue with headers in DefaultWebClient This commit fixes a lazy initialization issue in `headers(Consumer)`. Issue: SPR-15657 --- .../web/reactive/function/client/DefaultWebClient.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultWebClient.java b/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultWebClient.java index 818e981855..c1ba022d64 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultWebClient.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultWebClient.java @@ -206,7 +206,7 @@ class DefaultWebClient implements WebClient { @Override public DefaultRequestBodySpec headers(Consumer headersConsumer) { Assert.notNull(headersConsumer, "'headersConsumer' must not be null"); - headersConsumer.accept(this.headers); + headersConsumer.accept(getHeaders()); return this; }