File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed
src/main/java/com/aliyun/oss Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,8 @@ public class ClientConfiguration {
105
105
106
106
private RetryStrategy retryStrategy ;
107
107
108
+ private boolean redirectEnable = true ;
109
+
108
110
public ClientConfiguration () {
109
111
super ();
110
112
AppendDefaultExcludeList (this .cnameExcludeList );
@@ -724,4 +726,26 @@ public void setRetryStrategy(RetryStrategy retryStrategy) {
724
726
this .retryStrategy = retryStrategy ;
725
727
}
726
728
729
+
730
+ /**
731
+ * Gets whether is enable redirection.
732
+ *
733
+ * @return whether is enable redirection.
734
+ */
735
+ public boolean isRedirectEnable () {
736
+ return redirectEnable ;
737
+ }
738
+
739
+ /**
740
+ * Sets whether is enable redirection.
741
+ *
742
+ * @param redirectEnable
743
+ * whether is enable redirection
744
+ */
745
+ public void setRedirectEnable (boolean redirectEnable ) {
746
+ this .redirectEnable = redirectEnable ;
747
+ }
748
+
749
+
750
+
727
751
}
Original file line number Diff line number Diff line change @@ -90,6 +90,7 @@ public DefaultServiceClient(ClientConfiguration config) {
90
90
requestConfigBuilder .setConnectTimeout (config .getConnectionTimeout ());
91
91
requestConfigBuilder .setSocketTimeout (config .getSocketTimeout ());
92
92
requestConfigBuilder .setConnectionRequestTimeout (config .getConnectionRequestTimeout ());
93
+ requestConfigBuilder .setRedirectsEnabled (config .isRedirectEnable ());
93
94
94
95
String proxyHost = config .getProxyHost ();
95
96
int proxyPort = config .getProxyPort ();
You can’t perform that action at this time.
0 commit comments