File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
src/main/java/com/qcloud/cos Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -131,6 +131,8 @@ public class ClientConfig {
131131
132132 private long preflightStatusUpdateInterval = 10 * 1000L ;
133133
134+ private boolean isRedirectsEnabled = false ;
135+
134136 // 不传入region 用于后续调用List Buckets(获取所有的bucket信息)
135137 public ClientConfig () {
136138 super ();
@@ -467,4 +469,12 @@ public void setCheckPreflightStatus(boolean checkPreflightStatus) {
467469 public long getPreflightStatusUpdateInterval () {
468470 return preflightStatusUpdateInterval ;
469471 }
472+
473+ public boolean isRedirectsEnabled () {
474+ return isRedirectsEnabled ;
475+ }
476+
477+ public void setRedirectsEnabled (boolean redirectsEnabled ) {
478+ isRedirectsEnabled = redirectsEnabled ;
479+ }
470480}
Original file line number Diff line number Diff line change @@ -205,7 +205,9 @@ private void initHttpClient() {
205205 .setConnectionRequestTimeout (
206206 this .clientConfig .getConnectionRequestTimeout ())
207207 .setConnectTimeout (this .clientConfig .getConnectionTimeout ())
208- .setSocketTimeout (this .clientConfig .getSocketTimeout ()).build ();
208+ .setSocketTimeout (this .clientConfig .getSocketTimeout ())
209+ .setRedirectsEnabled (this .clientConfig .isRedirectsEnabled ())
210+ .build ();
209211 this .idleConnectionMonitor = new IdleConnectionMonitorThread (this .connectionManager );
210212 this .idleConnectionMonitor .setIdleAliveMS (this .clientConfig .getIdleConnectionAlive ());
211213 this .idleConnectionMonitor .setDaemon (true );
You can’t perform that action at this time.
0 commit comments