mirror of
https://github.com/tencentmusic/supersonic.git
synced 2026-04-23 07:34:20 +08:00
(improvement)(launcher) upgrade to the latest httpclient&core to support "LaxRedirectStrategy"
This commit is contained in:
@@ -2,8 +2,7 @@ package com.tencent.supersonic.config;
|
||||
|
||||
|
||||
|
||||
import org.apache.hc.client5.http.impl.DefaultRedirectStrategy;
|
||||
//import org.apache.hc.client5.http.impl.LaxRedirectStrategy;
|
||||
import org.apache.hc.client5.http.impl.LaxRedirectStrategy;
|
||||
import org.apache.hc.client5.http.impl.classic.CloseableHttpClient;
|
||||
import org.apache.hc.client5.http.impl.classic.HttpClientBuilder;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@@ -22,8 +21,8 @@ public class RestTemplateConfig {
|
||||
|
||||
// HttpClient 5 较新版本才会有LaxRedirectStrategy, 所以我重新定义了
|
||||
CloseableHttpClient httpClient =
|
||||
HttpClientBuilder.create().setRedirectStrategy(new DefaultRedirectStrategy()) // 使用宽松重定向策略
|
||||
//HttpClientBuilder.create().setRedirectStrategy(new LaxRedirectStrategy()) // 使用宽松重定向策略
|
||||
//HttpClientBuilder.create().setRedirectStrategy(new DefaultRedirectStrategy()) // 使用宽松重定向策略
|
||||
HttpClientBuilder.create().setRedirectStrategy(new LaxRedirectStrategy()) // 使用宽松重定向策略
|
||||
.build();
|
||||
|
||||
HttpComponentsClientHttpRequestFactory httpRequestFactory =
|
||||
|
||||
Reference in New Issue
Block a user