Follow redirects in JdkClientHttpRequestFactory
Make sure we follow redirects in the default HttpClient created by JdkClientHttpRequestFactory, similar toSimpleClientHttpRequestFactory.
This commit is contained in:
parent
6793edc349
commit
7c37f4bc51
|
@ -48,10 +48,12 @@ public class JdkClientHttpRequestFactory implements ClientHttpRequestFactory {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new instance of the {@code JdkClientHttpRequestFactory}
|
* Create a new instance of the {@code JdkClientHttpRequestFactory}
|
||||||
* with a default {@link HttpClient}.
|
* with a default {@link HttpClient} that follows redirects.
|
||||||
*/
|
*/
|
||||||
public JdkClientHttpRequestFactory() {
|
public JdkClientHttpRequestFactory() {
|
||||||
this(HttpClient.newHttpClient());
|
this(HttpClient.newBuilder()
|
||||||
|
.followRedirects(HttpClient.Redirect.NORMAL)
|
||||||
|
.build());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue