File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
src/main/java/org/apache/pulsar/manager/zuul Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 17
17
import org .apache .http .conn .ssl .TrustSelfSignedStrategy ;
18
18
import org .apache .http .impl .client .CloseableHttpClient ;
19
19
import org .apache .http .impl .client .HttpClients ;
20
+ import org .apache .http .impl .client .LaxRedirectStrategy ;
20
21
import org .apache .http .ssl .SSLContexts ;
21
22
import org .springframework .beans .factory .annotation .Value ;
22
23
import org .springframework .context .annotation .Bean ;
@@ -46,6 +47,12 @@ public class HttpsClientConfiguration {
46
47
47
48
@ Bean
48
49
public CloseableHttpClient httpClient () throws Exception {
50
+ LaxRedirectStrategy customLaxRedirectStrategy = new LaxRedirectStrategy () {
51
+ @ Override
52
+ protected boolean isRedirectable (final String method ) {
53
+ return true ;
54
+ }
55
+ };
49
56
if (tlsEnabled ) {
50
57
Resource resource = new FileSystemResource (tlsKeystore );
51
58
File trustStoreFile = resource .getFile ();
@@ -68,9 +75,10 @@ public CloseableHttpClient httpClient() throws Exception {
68
75
hostnameVerifier );
69
76
70
77
return HttpClients .custom ()
78
+ .setRedirectStrategy (customLaxRedirectStrategy )
71
79
.setSSLSocketFactory (sslsf )
72
80
.build ();
73
81
}
74
- return HttpClients .custom ().build ();
82
+ return HttpClients .custom ().setRedirectStrategy ( customLaxRedirectStrategy ). build ();
75
83
}
76
84
}
You can’t perform that action at this time.
0 commit comments