diff --git a/src/backend/common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/util/ClusterUtils.kt b/src/backend/common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/util/ClusterUtils.kt index 5eb1954ade..db024912a2 100644 --- a/src/backend/common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/util/ClusterUtils.kt +++ b/src/backend/common/common-metadata/metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/util/ClusterUtils.kt @@ -156,7 +156,7 @@ object ClusterUtils { throw e } } catch (e: RetryableException) { - if (e.message?.contains("Read time out") == true) { + if (e.message?.contains("Read timed out") == true) { logger.info("ignore feign exception: ${e.message}") return } diff --git a/src/backend/fs/boot-fs-server/src/main/kotlin/com/tencent/bkrepo/fs/server/request/StreamRequest.kt b/src/backend/fs/boot-fs-server/src/main/kotlin/com/tencent/bkrepo/fs/server/request/StreamRequest.kt index cb64e9c9f9..c89d9c6980 100644 --- a/src/backend/fs/boot-fs-server/src/main/kotlin/com/tencent/bkrepo/fs/server/request/StreamRequest.kt +++ b/src/backend/fs/boot-fs-server/src/main/kotlin/com/tencent/bkrepo/fs/server/request/StreamRequest.kt @@ -1,12 +1,22 @@ package com.tencent.bkrepo.fs.server.request import com.tencent.bkrepo.common.api.exception.ParameterInvalidException +import org.slf4j.LoggerFactory import org.springframework.web.reactive.function.server.ServerRequest import org.springframework.web.reactive.function.server.queryParamOrNull class StreamRequest(val request: ServerRequest) : NodeRequest(request) { - val size = request.queryParamOrNull("size")?.toLong() - ?: throw ParameterInvalidException("required size parameter.") + val size = try { + request.queryParamOrNull("size")?.toLong() ?: throw ParameterInvalidException("size") + } catch (e: NumberFormatException) { + logger.info("invalid size parameter: ${request.queryParamOrNull("size")}") + throw ParameterInvalidException("size") + } + val overwrite = request.headers().header("X-BKREPO-OVERWRITE").firstOrNull()?.toBoolean() ?: false val expires = request.headers().header("X-BKREPO-EXPIRES").firstOrNull()?.toLong() ?: 0 + + companion object { + private val logger = LoggerFactory.getLogger(StreamRequest::class.java) + } }