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 {
@Override @Override
public DefaultRequestBodySpec headers(Consumer<HttpHeaders> headersConsumer) { public DefaultRequestBodySpec headers(Consumer<HttpHeaders> headersConsumer) {
Assert.notNull(headersConsumer, "'headersConsumer' must not be null"); Assert.notNull(headersConsumer, "'headersConsumer' must not be null");
headersConsumer.accept(this.headers); headersConsumer.accept(getHeaders());
return this; return this;
} }

Loading…
Cancel
Save