Commit c8be9561 by Johannes Edmeier

Use the SimpleClientHttpRequestFactory

Apparently when the Netty4ClientHttpRequestFactory is being used the content- lenght header is not being set in the POST request. Therefore the simple one is now being hardcoded to override decetion by the RestTemplateBuilder. fixes #248
parent 99369f27
...@@ -22,6 +22,7 @@ import org.springframework.boot.web.client.RestTemplateBuilder; ...@@ -22,6 +22,7 @@ import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional; import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.http.client.SimpleClientHttpRequestFactory;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import de.codecentric.boot.admin.services.ApplicationRegistrator; import de.codecentric.boot.admin.services.ApplicationRegistrator;
...@@ -48,7 +49,8 @@ public class SpringBootAdminClientAutoConfiguration { ...@@ -48,7 +49,8 @@ public class SpringBootAdminClientAutoConfiguration {
@ConditionalOnMissingBean @ConditionalOnMissingBean
public ApplicationRegistrator registrator() { public ApplicationRegistrator registrator() {
RestTemplateBuilder builder = restTemplBuilder RestTemplateBuilder builder = restTemplBuilder
.messageConverters(new MappingJackson2HttpMessageConverter()); .messageConverters(new MappingJackson2HttpMessageConverter())
.requestFactory(SimpleClientHttpRequestFactory.class);
if (admin.getUsername() != null) { if (admin.getUsername() != null) {
builder = builder.basicAuthorization(admin.getUsername(), admin.getPassword()); builder = builder.basicAuthorization(admin.getUsername(), admin.getPassword());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment