Skip to content

Commit c29bb1a

Browse files
committed
update core,modify ecs endpoint
1 parent 0b145d7 commit c29bb1a

3 files changed

Lines changed: 51 additions & 41 deletions

File tree

aliyun-java-sdk-core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<groupId>com.aliyun</groupId>
44
<artifactId>aliyun-java-sdk-core</artifactId>
55
<packaging>jar</packaging>
6-
<version>3.0.9</version>
6+
<version>3.0.10</version>
77
<name>aliyun-java-sdk-core</name>
88
<url>http://www.aliyun.com</url>
99
<description>Aliyun Open API SDK for Java

aliyun-java-sdk-core/src/main/java/com/aliyuncs/DefaultAcsClient.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public class DefaultAcsClient implements IAcsClient{
4444
private int maxRetryNumber = 3;
4545
private boolean autoRetry = true;
4646
private IClientProfile clientProfile = null;
47+
private boolean urlTestFlag = false;
4748

4849
public DefaultAcsClient() {
4950
this.clientProfile = DefaultProfile.getProfile();
@@ -185,6 +186,11 @@ public <T extends AcsResponse> HttpResponse doAction(AcsRequest<T> request,
185186
throw new ClientException("SDK.InvalidRegionId", "Can not find endpoint to access.");
186187
}
187188
HttpRequest httpRequest = request.signRequest(signer, credential, format, domain);
189+
190+
if (this.urlTestFlag) {
191+
throw new ClientException("URLTestFlagIsSet", httpRequest.getUrl());
192+
}
193+
188194
int retryTimes = 1;
189195
HttpResponse response = HttpResponse.getResponse(httpRequest);
190196
while (500 <= response.getStatus() && autoRetry && retryTimes < maxRetryNumber) {
@@ -260,4 +266,8 @@ public int getMaxRetryNumber() {
260266
public void setMaxRetryNumber(int maxRetryNumber) {
261267
this.maxRetryNumber = maxRetryNumber;
262268
}
269+
270+
public void setUrlTestFlag(boolean flag) {
271+
this.urlTestFlag = flag;
272+
}
263273
}

0 commit comments

Comments
 (0)