From 8ac3b274ea43be7216e1959e3f28ac3277bbbf20 Mon Sep 17 00:00:00 2001 From: Alexey Fetisov Date: Wed, 1 Oct 2025 16:25:48 +0300 Subject: [PATCH] v12.3.0 --- check.go | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/check.go b/check.go index 4e78848..aea68fd 100644 --- a/check.go +++ b/check.go @@ -28,8 +28,10 @@ func (de DecortClient) Check() (*CheckInfo, error) { err = json.Unmarshal([]byte(strings.Replace(strings.Trim(string(res), `"`), "\\", "", -1)), &info) if err != nil { - if _, exists := constants.VersionMap[string(res)]; exists { - info.Version = string(res) + var v string + json.Unmarshal([]byte(res), &v) + if _, exists := constants.VersionMap[v]; exists { + info.Version = v } else { return nil, fmt.Errorf("platform version isn't supported") } @@ -55,7 +57,13 @@ func (bvs BVSDecortClient) Check() (*CheckInfo, error) { err = json.Unmarshal([]byte(strings.Replace(strings.Trim(string(res), `"`), "\\", "", -1)), &info) if err != nil { - return nil, err + var v string + json.Unmarshal([]byte(res), &v) + if _, exists := constants.VersionMap[v]; exists { + info.Version = v + } else { + return nil, fmt.Errorf("platform version isn't supported") + } } if v, ok := constants.VersionMap[info.Version]; ok { @@ -78,7 +86,13 @@ func (ldc LegacyDecortClient) Check() (*CheckInfo, error) { err = json.Unmarshal([]byte(strings.Replace(strings.Trim(string(res), `"`), "\\", "", -1)), &info) if err != nil { - return nil, err + var v string + json.Unmarshal([]byte(res), &v) + if _, exists := constants.VersionMap[v]; exists { + info.Version = v + } else { + return nil, fmt.Errorf("platform version isn't supported") + } } if v, ok := constants.VersionMap[info.Version]; ok {