diff --git a/pom.xml b/pom.xml
index 59fe5d5a..b42a97fe 100644
--- a/pom.xml
+++ b/pom.xml
@@ -11,7 +11,7 @@
com.aliyun.oss
aliyun-sdk-oss
- 3.4.1
+ 3.4.2
jar
Aliyun OSS SDK for Java
The Aliyun OSS SDK for Java used for accessing Aliyun Object Storage Service
diff --git a/src/main/java/com/aliyun/oss/OSSClient.java b/src/main/java/com/aliyun/oss/OSSClient.java
index f8a4c8a4..c667de5f 100644
--- a/src/main/java/com/aliyun/oss/OSSClient.java
+++ b/src/main/java/com/aliyun/oss/OSSClient.java
@@ -257,7 +257,7 @@ private boolean isIpOrLocalhost(URI uri) {
return false;
}
- if (ia.getHostName().equals(ia.getHostAddress())) {
+ if (uri.getHost().equals(ia.getHostAddress())) {
return true;
}
diff --git a/src/main/resources/versioninfo.properties b/src/main/resources/versioninfo.properties
index 1e95b09f..7ca723a7 100644
--- a/src/main/resources/versioninfo.properties
+++ b/src/main/resources/versioninfo.properties
@@ -1 +1 @@
-version=3.4.1
+version=3.4.2
diff --git a/src/test/java/com/aliyun/oss/common/utils/VersionUtilTest.java b/src/test/java/com/aliyun/oss/common/utils/VersionUtilTest.java
index 72a7b5ea..2e58e7e8 100644
--- a/src/test/java/com/aliyun/oss/common/utils/VersionUtilTest.java
+++ b/src/test/java/com/aliyun/oss/common/utils/VersionUtilTest.java
@@ -28,7 +28,7 @@ public class VersionUtilTest {
@Test
public void testGetDefaultUserAgent() {
String userAgent = VersionInfoUtils.getDefaultUserAgent();
- assertTrue(userAgent.startsWith("aliyun-sdk-java/3.4.1("));
+ assertTrue(userAgent.startsWith("aliyun-sdk-java/3.4.2("));
assertEquals(userAgent.split("/").length, 4);
assertEquals(userAgent.split(";").length, 2);
assertEquals(userAgent.split("\\(").length, 2);