diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b53ac80..2094f375 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ All notable changes to QingStor SDK for JAVA will be documented in this file. +## [v2.6.6] - 2024-12-24 + +### Fixed + +- Fix the bug that the header `x-qs-date` is not considered in the signature calculation. +- Fix the bug that decoding versioned delete-object output fails on boolean field. +- Use -1 as unknown body size hint before parsing the content length. + ## [v2.6.5] - 2024-04-30 ### Added diff --git a/Makefile b/Makefile index b6cbb6e1..5163cef4 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,13 @@ SHELL := /bin/bash +.PHONY: help all test unit build update generate + help: @echo "Please use \`make ' where is one of" @echo " all to update, generate and test this SDK" @echo " test to run service test" @echo " unit to run all sort of unit tests except runtime" + @echo " build to build jar" @echo " update to update git submodules" @echo " generate to generate service code" diff --git a/docs/install.md b/docs/install.md index f3be06ad..a423d40e 100644 --- a/docs/install.md +++ b/docs/install.md @@ -22,7 +22,7 @@ Maven: com.yunify qingstor.sdk.java - 2.6.5 + 2.6.6 ``` diff --git a/docs/install_zh-CN.md b/docs/install_zh-CN.md index ab21b515..d5bf0659 100644 --- a/docs/install_zh-CN.md +++ b/docs/install_zh-CN.md @@ -22,7 +22,7 @@ Maven: com.yunify qingstor.sdk.java - 2.6.5 + 2.6.6 ``` diff --git a/pom.xml b/pom.xml index 86505c75..e589cca2 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.yunify qingstor.sdk.java - 2.6.5 + 2.6.6 Qingcloud Qingstor SDK for Java The official QingStor SDK for the Java programming language. https://www.qingcloud.com/products/objectstorage/ @@ -40,6 +40,7 @@ + com.squareup.okhttp3 okhttp 4.12.0 @@ -269,7 +270,7 @@ - 1.10.0 + 1.7 diff --git a/src/main/java/com/qingstor/sdk/constants/QSConstant.java b/src/main/java/com/qingstor/sdk/constants/QSConstant.java index 83e0453f..6c427db7 100644 --- a/src/main/java/com/qingstor/sdk/constants/QSConstant.java +++ b/src/main/java/com/qingstor/sdk/constants/QSConstant.java @@ -64,6 +64,7 @@ public class QSConstant { public static final String ENV_CONTEXT_KEY = "envContext"; public static final String HEADER_PARAM_KEY_DATE = "Date"; + public static final String HEADER_PARAM_KEY_QS_DATE = "x-qs-date"; public static final String HEADER_PARAM_KEY_EXPIRES = "Expires"; diff --git a/src/main/java/com/qingstor/sdk/utils/QSJSONUtil.java b/src/main/java/com/qingstor/sdk/utils/QSJSONUtil.java index c398dbfb..becc2af5 100644 --- a/src/main/java/com/qingstor/sdk/utils/QSJSONUtil.java +++ b/src/main/java/com/qingstor/sdk/utils/QSJSONUtil.java @@ -530,6 +530,8 @@ private static Object getParseValue(Class type, Object value) { return Long.parseLong(value.toString()); } else if (Float.class.equals(type) || "float".equals(type.toString())) { return Float.parseFloat(value.toString()); + } else if (Boolean.class.equals(type) || "boolean".equals(type.toString())) { + return Boolean.parseBoolean(value.toString()); } return value; } diff --git a/src/main/java/com/qingstor/sdk/utils/QSSignatureUtil.java b/src/main/java/com/qingstor/sdk/utils/QSSignatureUtil.java index 0b55c05f..c212e51a 100644 --- a/src/main/java/com/qingstor/sdk/utils/QSSignatureUtil.java +++ b/src/main/java/com/qingstor/sdk/utils/QSSignatureUtil.java @@ -213,11 +213,12 @@ public static String getStringToSignature( // Append request time as string String dateStr = ""; if (headers != null) { - if (headers.containsKey(QSConstant.HEADER_PARAM_KEY_DATE)) { - dateStr = headers.get(QSConstant.HEADER_PARAM_KEY_DATE); - } if (headers.containsKey(QSConstant.HEADER_PARAM_KEY_EXPIRES)) { dateStr = headers.get(QSConstant.HEADER_PARAM_KEY_EXPIRES); + } else { + if (!headers.containsKey(QSConstant.HEADER_PARAM_KEY_QS_DATE)) { + dateStr = headers.get(QSConstant.HEADER_PARAM_KEY_DATE); + } } } sb.append("\n").append(dateStr); diff --git a/src/main/resources/version.properties b/src/main/resources/version.properties index 0759335f..b978ba7d 100644 --- a/src/main/resources/version.properties +++ b/src/main/resources/version.properties @@ -1 +1 @@ -version=2.6.5 +version=2.6.6