From ba060b53a0d25f79e44663eb883f5de970baad98 Mon Sep 17 00:00:00 2001 From: xuyaming Date: Fri, 3 Mar 2023 15:58:55 +0800 Subject: [PATCH 1/2] feat: update tos --- common/common_volcengine_tos_client.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/common/common_volcengine_tos_client.go b/common/common_volcengine_tos_client.go index 3f37aa05..34cf9b19 100644 --- a/common/common_volcengine_tos_client.go +++ b/common/common_volcengine_tos_client.go @@ -101,8 +101,11 @@ func (u *Tos) newTosClient(domain string) *client.Client { } func (u *Tos) DoTosCall(info TosInfo, input *map[string]interface{}) (output *map[string]interface{}, err error) { + var content *os.File defer func() { - + if content != nil { + err = content.Close() + } }() c := u.newTosClient(info.Domain) trueInput := make(map[string]interface{}) @@ -133,7 +136,7 @@ func (u *Tos) DoTosCall(info TosInfo, input *map[string]interface{}) (output *ma } if info.ContentPath != "" && (op.HTTPMethod == "PUT" || op.HTTPMethod == "POST") { - content, _ := os.Open(info.ContentPath) + content, _ = os.Open(info.ContentPath) req.Body = content req.HTTPRequest.Header.Set("Content-Length", strconv.FormatInt(u.tryResolveLength(content), 10)) } From 67bdefa4ef4a004e3c8d533a22c8a4a2fec395ff Mon Sep 17 00:00:00 2001 From: xuyaming Date: Fri, 3 Mar 2023 15:59:24 +0800 Subject: [PATCH 2/2] feat: update tos --- common/common_volcengine_version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/common_volcengine_version.go b/common/common_volcengine_version.go index c688c360..661bb73f 100644 --- a/common/common_volcengine_version.go +++ b/common/common_volcengine_version.go @@ -2,5 +2,5 @@ package common const ( TerraformProviderName = "terraform-provider-volcengine" - TerraformProviderVersion = "0.0.58" + TerraformProviderVersion = "0.0.59" )