Browse Source

Fix initialization issue with headers in DefaultWebClient

This commit fixes a lazy initialization issue in
`headers(Consumer<HttpHeaders>)`.

Issue: SPR-15657
pull/1448/merge
Arjen Poutsma 8 years ago
parent
commit
4f39edc905
  1. 2
      spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultWebClient.java

2
spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultWebClient.java

@ -206,7 +206,7 @@ class DefaultWebClient implements WebClient { @@ -206,7 +206,7 @@ class DefaultWebClient implements WebClient {
@Override
public DefaultRequestBodySpec headers(Consumer<HttpHeaders> headersConsumer) {
Assert.notNull(headersConsumer, "'headersConsumer' must not be null");
headersConsumer.accept(this.headers);
headersConsumer.accept(getHeaders());
return this;
}

Loading…
Cancel
Save