diff --git a/common/common_volcengine_bypass_call.go b/common/common_volcengine_bypass_call.go index 8d2a8938..f1b0cfad 100644 --- a/common/common_volcengine_bypass_call.go +++ b/common/common_volcengine_bypass_call.go @@ -102,6 +102,7 @@ func (u *BypassSvc) DoBypassSvcCall(info BypassSvcInfo, input *map[string]interf if info.ContentPath != "" && (op.HTTPMethod == "PUT" || op.HTTPMethod == "POST") { content, _ = os.Open(info.ContentPath) req.Body = content + req.ResetBody() req.HTTPRequest.Header.Set("Content-Length", strconv.FormatInt(u.tryResolveLength(content), 10)) } diff --git a/volcengine/tos/bucket_policy/resource_volcengine_tos_bucket_policy.go b/volcengine/tos/bucket_policy/resource_volcengine_tos_bucket_policy.go index 6b923ab9..775dd65a 100644 --- a/volcengine/tos/bucket_policy/resource_volcengine_tos_bucket_policy.go +++ b/volcengine/tos/bucket_policy/resource_volcengine_tos_bucket_policy.go @@ -119,7 +119,7 @@ func resourceVolcengineTosBucketPolicyCreate(d *schema.ResourceData, meta interf tosBucketService := NewTosBucketPolicyService(meta.(*ve.SdkClient)) err = ve.DefaultDispatcher().Create(tosBucketService, d, ResourceVolcengineTosBucketPolicy()) if err != nil { - return fmt.Errorf("error on creating tos bucket %q, %s", d.Id(), err) + return fmt.Errorf("error on creating tos bucket policy %q, %s", d.Id(), err) } return resourceVolcengineTosBucketPolicyRead(d, meta) } @@ -128,7 +128,7 @@ func resourceVolcengineTosBucketPolicyRead(d *schema.ResourceData, meta interfac tosBucketService := NewTosBucketPolicyService(meta.(*ve.SdkClient)) err = ve.DefaultDispatcher().Read(tosBucketService, d, ResourceVolcengineTosBucketPolicy()) if err != nil { - return fmt.Errorf("error on reading tos bucket %q, %s", d.Id(), err) + return fmt.Errorf("error on reading tos bucket policy %q, %s", d.Id(), err) } return err } @@ -137,7 +137,7 @@ func resourceVolcengineTosBucketPolicyUpdate(d *schema.ResourceData, meta interf tosBucketService := NewTosBucketPolicyService(meta.(*ve.SdkClient)) err = ve.DefaultDispatcher().Update(tosBucketService, d, ResourceVolcengineTosBucketPolicy()) if err != nil { - return fmt.Errorf("error on updating tos bucket %q, %s", d.Id(), err) + return fmt.Errorf("error on updating tos bucket policy %q, %s", d.Id(), err) } return resourceVolcengineTosBucketPolicyRead(d, meta) } @@ -146,7 +146,7 @@ func resourceVolcengineTosBucketPolicyDelete(d *schema.ResourceData, meta interf tosBucketService := NewTosBucketPolicyService(meta.(*ve.SdkClient)) err = ve.DefaultDispatcher().Delete(tosBucketService, d, ResourceVolcengineTosBucketPolicy()) if err != nil { - return fmt.Errorf("error on deleting tos bucket %q, %s", d.Id(), err) + return fmt.Errorf("error on deleting tos bucket policy %q, %s", d.Id(), err) } return err } diff --git a/volcengine/tos/object/resource_volcengine_tos_object.go b/volcengine/tos/object/resource_volcengine_tos_object.go index 95bb8e3b..90a9c209 100644 --- a/volcengine/tos/object/resource_volcengine_tos_object.go +++ b/volcengine/tos/object/resource_volcengine_tos_object.go @@ -171,7 +171,7 @@ func resourceVolcengineTosObjectCreate(d *schema.ResourceData, meta interface{}) tosBucketService := NewTosObjectService(meta.(*ve.SdkClient)) err = ve.DefaultDispatcher().Create(tosBucketService, d, ResourceVolcengineTosObject()) if err != nil { - return fmt.Errorf("error on creating tos bucket %q, %s", d.Id(), err) + return fmt.Errorf("error on creating tos object %q, %s", d.Id(), err) } return resourceVolcengineTosObjectRead(d, meta) } @@ -180,7 +180,7 @@ func resourceVolcengineTosObjectRead(d *schema.ResourceData, meta interface{}) ( tosBucketService := NewTosObjectService(meta.(*ve.SdkClient)) err = ve.DefaultDispatcher().Read(tosBucketService, d, ResourceVolcengineTosObject()) if err != nil { - return fmt.Errorf("error on reading tos bucket %q, %s", d.Id(), err) + return fmt.Errorf("error on reading tos object %q, %s", d.Id(), err) } return err } @@ -189,7 +189,7 @@ func resourceVolcengineTosObjectUpdate(d *schema.ResourceData, meta interface{}) tosBucketService := NewTosObjectService(meta.(*ve.SdkClient)) err = ve.DefaultDispatcher().Update(tosBucketService, d, ResourceVolcengineTosObject()) if err != nil { - return fmt.Errorf("error on updating tos bucket %q, %s", d.Id(), err) + return fmt.Errorf("error on updating tos object %q, %s", d.Id(), err) } return resourceVolcengineTosObjectRead(d, meta) } @@ -198,7 +198,7 @@ func resourceVolcengineTosObjectDelete(d *schema.ResourceData, meta interface{}) tosBucketService := NewTosObjectService(meta.(*ve.SdkClient)) err = ve.DefaultDispatcher().Delete(tosBucketService, d, ResourceVolcengineTosObject()) if err != nil { - return fmt.Errorf("error on deleting tos bucket %q, %s", d.Id(), err) + return fmt.Errorf("error on deleting tos object %q, %s", d.Id(), err) } return err }