Skip to content

Commit d018085

Browse files
committed
Update function parseRegionName, so it correctly deal with uri that ends
up with amazonaws.com.cn
1 parent 84c1016 commit d018085

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

aws-android-sdk-core/src/main/java/com/amazonaws/util/AwsHostNameUtils.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ public static String parseRegionName(final String host,
6868
return parseStandardRegionName(host.substring(0, index));
6969
}
7070

71+
if (host.endsWith(".amazonaws.com.cn")) {
72+
int index = host.length() - ".amazonaws.com.cn".length();
73+
return parseStandardRegionName(host.substring(0, index));
74+
}
75+
7176
if (serviceHint != null) {
7277
// If we have a service hint, look for 'service.[region]' or
7378
// 'service-[region]' in the endpoint's hostname.

0 commit comments

Comments
 (0)