From d4ad6c562c45eb732a01118e3b7560110bad41d2 Mon Sep 17 00:00:00 2001 From: Rubicon Lee <132176609+raff-wakflo@users.noreply.github.com> Date: Thu, 8 Aug 2024 19:20:48 -0500 Subject: [PATCH] fix: bumped sdk version and fixed http errors Signed-off-by: Rubicon Lee <132176609+raff-wakflo@users.noreply.github.com> --- go.mod | 10 +++++----- go.sum | 18 +++++++++-------- internal/connectors/googledrive/lib_test.go | 2 +- internal/connectors/googledrive/shared.go | 20 +++++++++++-------- .../googledrive/trigger_new_file.go | 11 ++++++---- .../javascript/operation_run_jscript.go | 1 + internal/connectors/slack/shared.go | 18 ++++++++--------- .../todoist/operation_create_project.go | 6 +++--- .../todoist/operation_create_task.go | 6 +++--- .../todoist/operation_get_active_task.go | 6 +++--- .../todoist/operation_get_project.go | 7 ++++--- .../todoist/operation_list_project.go | 6 +++--- .../operation_list_project_collaborators.go | 6 +++--- .../todoist/operation_list_tasks.go | 6 +++--- .../todoist/operation_update_project.go | 6 +++--- .../todoist/operation_update_task.go | 6 +++--- internal/connectors/todoist/shared.go | 18 ++++++++--------- 17 files changed, 82 insertions(+), 71 deletions(-) diff --git a/go.mod b/go.mod index fb84a56..f7a2620 100644 --- a/go.mod +++ b/go.mod @@ -6,14 +6,15 @@ go 1.22.2 require ( github.com/clarkmcc/go-typescript v0.7.0 - github.com/dop251/goja v0.0.0-20240516125602-ccbae20bcec2 + github.com/dop251/goja v0.0.0-20240806095544-3491d4a58fbe github.com/gocarina/gocsv v0.0.0-20240520201108-78e41c74b4b1 github.com/gookit/goutil v0.6.15 github.com/open2b/scriggo v0.56.1 - github.com/opus-domini/fast-shot v0.10.0 + github.com/opus-domini/fast-shot v1.1.2 github.com/rs/zerolog v1.33.0 - github.com/wakflo/go-sdk v0.4.2 + github.com/wakflo/go-sdk v0.4.3 golang.org/x/crypto v0.24.0 + golang.org/x/oauth2 v0.20.0 google.golang.org/api v0.181.0 ) @@ -25,7 +26,7 @@ require ( github.com/Masterminds/semver/v3 v3.2.1 // indirect github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect github.com/cavaliergopher/grab/v3 v3.0.1 // indirect - github.com/dlclark/regexp2 v1.7.0 // indirect + github.com/dlclark/regexp2 v1.11.4 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/gabriel-vasile/mimetype v1.4.4 // indirect github.com/go-logr/logr v1.4.2 // indirect @@ -62,7 +63,6 @@ require ( go.opentelemetry.io/otel/trace v1.27.0 // indirect golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc // indirect golang.org/x/net v0.26.0 // indirect - golang.org/x/oauth2 v0.20.0 // indirect golang.org/x/sys v0.21.0 // indirect golang.org/x/text v0.16.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240521202816-d264139d666e // indirect diff --git a/go.sum b/go.sum index b8e4816..cfa9c7c 100644 --- a/go.sum +++ b/go.sum @@ -23,10 +23,10 @@ github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSV github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dlclark/regexp2 v1.7.0 h1:7lJfhqlPssTb1WQx4yvTHN0uElPEv52sbaECrAQxjAo= -github.com/dlclark/regexp2 v1.7.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= -github.com/dop251/goja v0.0.0-20240516125602-ccbae20bcec2 h1:OFTHt+yJDo/uaIKMGjEKzc3DGhrpQZoqvMUIloZv6ZY= -github.com/dop251/goja v0.0.0-20240516125602-ccbae20bcec2/go.mod h1:o31y53rb/qiIAONF7w3FHJZRqqP3fzHUr1HqanthByw= +github.com/dlclark/regexp2 v1.11.4 h1:rPYF9/LECdNymJufQKmri9gV604RvvABwgOA8un7yAo= +github.com/dlclark/regexp2 v1.11.4/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= +github.com/dop251/goja v0.0.0-20240806095544-3491d4a58fbe h1:jwFJkgsdelB87ohlXaAGSd05Cb5ALDFa9iW9IGRHcRM= +github.com/dop251/goja v0.0.0-20240806095544-3491d4a58fbe/go.mod h1:DF+w/nLMIkvRpyhd/0K+Okbh3fVZBtXLwRtS/ccAa5w= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -127,8 +127,8 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/open2b/scriggo v0.56.1 h1:h3IVNM0OEvszbtdmukaJj9lPo/xSvHPclYm/RqQqUxY= github.com/open2b/scriggo v0.56.1/go.mod h1:FJS0k7CaKq2sNlrqAGMwU4dCltYqC1c+Eak3dj5w26Q= -github.com/opus-domini/fast-shot v0.10.0 h1:zWbPy6KJZvNs0pUa0erF9TyeDsLZHDVZf4oDHOd6JGY= -github.com/opus-domini/fast-shot v0.10.0/go.mod h1:sg5+f0VviAIIdrv24WLHL6kV7kWs4PsVDbSkr2TPYWw= +github.com/opus-domini/fast-shot v1.1.2 h1:02cyRhjASTWLJEY0QNLuUSmfNAbws5UMtfY1b6yimCA= +github.com/opus-domini/fast-shot v1.1.2/go.mod h1:BOr2JXHQJhOnYsxyCvFbgBP3BuYCjgh2YfzWKweEL0A= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -139,14 +139,16 @@ github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWR github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/wakflo/go-sdk v0.4.2 h1:CCmRrmyTm5tdjaxKrIas7uVD06XDbsPEqEVPzznK9o8= -github.com/wakflo/go-sdk v0.4.2/go.mod h1:hJ4utGZ8WYRdZ3Ey/ylv9ogswhDAjcmQ9Drk4IaXwvc= +github.com/wakflo/go-sdk v0.4.3 h1:azWuZCNVD4zu2UV0g4ENIWSgd2Yg1r63gFRqtzZaJmc= +github.com/wakflo/go-sdk v0.4.3/go.mod h1:hJ4utGZ8WYRdZ3Ey/ylv9ogswhDAjcmQ9Drk4IaXwvc= github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no= github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= diff --git a/internal/connectors/googledrive/lib_test.go b/internal/connectors/googledrive/lib_test.go index d6d191d..cc7fe54 100644 --- a/internal/connectors/googledrive/lib_test.go +++ b/internal/connectors/googledrive/lib_test.go @@ -111,7 +111,7 @@ func TestNewConnector(t *testing.T) { // if err != nil { // t.Errorf("NewConnector() RunTrigger() with name %v threw an error = %v", testCase.operationName, err) // } - //} else { + // } else { // _, err = spider.RunOperation(testCase.operationName, testCase.ctx) // if err != nil { // t.Errorf("NewConnector() RunOperation() with name %v threw an error = %v", testCase.operationName, err) diff --git a/internal/connectors/googledrive/shared.go b/internal/connectors/googledrive/shared.go index 94b05a7..64adf06 100644 --- a/internal/connectors/googledrive/shared.go +++ b/internal/connectors/googledrive/shared.go @@ -326,17 +326,18 @@ func getParentFoldersInput() *sdkcore.AutoFormSchema { return nil, err } - if rsp.IsError() { - return nil, errors.New(rsp.StatusText()) + if rsp.Status().IsError() { + return nil, errors.New(rsp.Status().Text()) } - bytes, err := io.ReadAll(rsp.RawBody()) + defer rsp.Body().Close() + byts, err := io.ReadAll(rsp.Body().Raw()) if err != nil { return nil, err } var body ListFileResponse - err = json.Unmarshal(bytes, &body) + err = json.Unmarshal(byts, &body) if err != nil { return nil, err } @@ -368,17 +369,20 @@ func getFoldersInput(title string, desc string, required bool) *sdkcore.AutoForm return nil, err } - if rsp.IsError() { - return nil, errors.New(rsp.StatusText()) + defer rsp.Body().Close() + + if rsp.Status().IsError() { + return nil, errors.New(rsp.Status().Text()) } - bytes, err := io.ReadAll(rsp.RawBody()) + defer rsp.Body().Close() + byts, err := io.ReadAll(rsp.Body().Raw()) if err != nil { return nil, err } var body ListFileResponse - err = json.Unmarshal(bytes, &body) + err = json.Unmarshal(byts, &body) if err != nil { return nil, err } diff --git a/internal/connectors/googledrive/trigger_new_file.go b/internal/connectors/googledrive/trigger_new_file.go index f065bee..0f68019 100644 --- a/internal/connectors/googledrive/trigger_new_file.go +++ b/internal/connectors/googledrive/trigger_new_file.go @@ -62,17 +62,20 @@ func NewTriggerNewFile() *TriggerNewFile { return nil, err } - if rsp.IsError() { - return nil, errors.New(rsp.StatusText()) + defer rsp.Body().Close() + + if rsp.Status().IsError() { + return nil, errors.New(rsp.Status().Text()) } - bytes, err := io.ReadAll(rsp.RawBody()) + defer rsp.Body().Close() + byts, err := io.ReadAll(rsp.Body().Raw()) if err != nil { return nil, err } var body ListFileResponse - err = json.Unmarshal(bytes, &body) + err = json.Unmarshal(byts, &body) if err != nil { return nil, err } diff --git a/internal/connectors/javascript/operation_run_jscript.go b/internal/connectors/javascript/operation_run_jscript.go index d2c75ce..5757ea8 100644 --- a/internal/connectors/javascript/operation_run_jscript.go +++ b/internal/connectors/javascript/operation_run_jscript.go @@ -89,6 +89,7 @@ func (c *RunJSOperation) Run(ctx *sdk.RunContext) (sdk.JSON, error) { arg := map[string]interface{}{ "auth": ctx.Auth, "input": input, + "steps": ctx.GetStepsState(), } res, err := execute(goja.Undefined(), vm.ToValue(arg)) if err != nil { diff --git a/internal/connectors/slack/shared.go b/internal/connectors/slack/shared.go index bc6f989..61465f4 100644 --- a/internal/connectors/slack/shared.go +++ b/internal/connectors/slack/shared.go @@ -67,11 +67,11 @@ func getUsers(client fastshot.ClientHttpMethods) ([]SlackUser, error) { return nil, err } - if resp.IsError() { - return nil, fmt.Errorf("bad HTTP request - error: %s", resp.StatusText()) + if resp.Status().IsError() { + return nil, fmt.Errorf("bad HTTP request - error: %s", resp.Status().Text()) } - respBytes, err := io.ReadAll(resp.RawBody()) + respBytes, err := io.ReadAll(resp.Raw().Body) if err != nil { return nil, err } @@ -115,11 +115,11 @@ func getChannels(client fastshot.ClientHttpMethods, channelTypes string) ([]Slac return nil, err } - if resp.IsError() { - return nil, fmt.Errorf("bad request - error: %s", resp.StatusText()) + if resp.Status().IsError() { + return nil, fmt.Errorf("bad request - error: %s", resp.Status().Text()) } - respBytes, err := io.ReadAll(resp.RawBody()) + respBytes, err := io.ReadAll(resp.Raw().Body) if err != nil { return nil, err } @@ -162,11 +162,11 @@ func sendMessage(client fastshot.ClientHttpMethods, message string, channelID st return err } - if resp.IsError() { - return fmt.Errorf("bad request - error: %s", resp.StatusText()) + if resp.Status().IsError() { + return fmt.Errorf("bad request - error: %s", resp.Status().Text()) } - respBytes, err := io.ReadAll(resp.RawBody()) + respBytes, err := io.ReadAll(resp.Raw().Body) if err != nil { return err } diff --git a/internal/connectors/todoist/operation_create_project.go b/internal/connectors/todoist/operation_create_project.go index 2fdbf6e..805b61a 100644 --- a/internal/connectors/todoist/operation_create_project.go +++ b/internal/connectors/todoist/operation_create_project.go @@ -80,11 +80,11 @@ func (c *CreateProjectOperation) Run(ctx *sdk.RunContext) (sdk.JSON, error) { return nil, err } - if rsp.IsError() { - return nil, errors.New(rsp.StatusText()) + if rsp.Status().IsError() { + return nil, errors.New(rsp.Status().Text()) } - bytes, err := io.ReadAll(rsp.RawBody()) + bytes, err := io.ReadAll(rsp.Raw().Body) if err != nil { return nil, err } diff --git a/internal/connectors/todoist/operation_create_task.go b/internal/connectors/todoist/operation_create_task.go index f9cf0cd..4117d61 100644 --- a/internal/connectors/todoist/operation_create_task.go +++ b/internal/connectors/todoist/operation_create_task.go @@ -114,11 +114,11 @@ func (c *CreateTaskOperation) Run(ctx *sdk.RunContext) (sdk.JSON, error) { return nil, err } - if rsp.IsError() { - return nil, errors.New(rsp.StatusText()) + if rsp.Status().IsError() { + return nil, errors.New(rsp.Status().Text()) } - bytes, err := io.ReadAll(rsp.RawBody()) + bytes, err := io.ReadAll(rsp.Raw().Body) if err != nil { return nil, err } diff --git a/internal/connectors/todoist/operation_get_active_task.go b/internal/connectors/todoist/operation_get_active_task.go index 3aad42e..81f3c1d 100644 --- a/internal/connectors/todoist/operation_get_active_task.go +++ b/internal/connectors/todoist/operation_get_active_task.go @@ -66,11 +66,11 @@ func (c *GetActiveTaskOperation) Run(ctx *sdk.RunContext) (sdk.JSON, error) { return nil, err } - if rsp.IsError() { - return nil, errors.New(rsp.StatusText()) + if rsp.Status().IsError() { + return nil, errors.New(rsp.Status().Text()) } - bytes, err := io.ReadAll(rsp.RawBody()) + bytes, err := io.ReadAll(rsp.Raw().Body) if err != nil { return nil, err } diff --git a/internal/connectors/todoist/operation_get_project.go b/internal/connectors/todoist/operation_get_project.go index dfd38e7..2e3ee7f 100644 --- a/internal/connectors/todoist/operation_get_project.go +++ b/internal/connectors/todoist/operation_get_project.go @@ -69,11 +69,12 @@ func (c *GetProjectOperation) Run(ctx *sdk.RunContext) (sdk.JSON, error) { if err != nil { return nil, err } - if rsp.IsError() { - return nil, errors.New(rsp.StatusText()) + + if rsp.Status().IsError() { + return nil, errors.New(rsp.Status().Text()) } - bytes, err := io.ReadAll(rsp.RawBody()) + bytes, err := io.ReadAll(rsp.Raw().Body) if err != nil { return nil, err } diff --git a/internal/connectors/todoist/operation_list_project.go b/internal/connectors/todoist/operation_list_project.go index fb82dd2..70e1464 100644 --- a/internal/connectors/todoist/operation_list_project.go +++ b/internal/connectors/todoist/operation_list_project.go @@ -66,11 +66,11 @@ func (c *ListProjectsOperation) Run(ctx *sdk.RunContext) (sdk.JSON, error) { return nil, err } - if rsp.IsError() { - return nil, errors.New(rsp.StatusText()) + if rsp.Status().IsError() { + return nil, errors.New(rsp.Status().Text()) } - bytes, err := io.ReadAll(rsp.RawBody()) + bytes, err := io.ReadAll(rsp.Raw().Body) if err != nil { return nil, err } diff --git a/internal/connectors/todoist/operation_list_project_collaborators.go b/internal/connectors/todoist/operation_list_project_collaborators.go index 010c715..aa13cb5 100644 --- a/internal/connectors/todoist/operation_list_project_collaborators.go +++ b/internal/connectors/todoist/operation_list_project_collaborators.go @@ -71,11 +71,11 @@ func (c *ListProjectCollaboratorsOperation) Run(ctx *sdk.RunContext) (sdk.JSON, return nil, err } - if rsp.IsError() { - return nil, errors.New(rsp.StatusText()) + if rsp.Status().IsError() { + return nil, errors.New(rsp.Status().Text()) } - bytes, err := io.ReadAll(rsp.RawBody()) + bytes, err := io.ReadAll(rsp.Raw().Body) if err != nil { return nil, err } diff --git a/internal/connectors/todoist/operation_list_tasks.go b/internal/connectors/todoist/operation_list_tasks.go index e44e391..decc3e4 100644 --- a/internal/connectors/todoist/operation_list_tasks.go +++ b/internal/connectors/todoist/operation_list_tasks.go @@ -91,11 +91,11 @@ func (c *ListTasksOperation) Run(ctx *sdk.RunContext) (sdk.JSON, error) { return nil, err } - if rsp.IsError() { - return nil, errors.New(rsp.StatusText()) + if rsp.Status().IsError() { + return nil, errors.New(rsp.Status().Text()) } - bytes, err := io.ReadAll(rsp.RawBody()) + bytes, err := io.ReadAll(rsp.Raw().Body) if err != nil { return nil, err } diff --git a/internal/connectors/todoist/operation_update_project.go b/internal/connectors/todoist/operation_update_project.go index 76a7b5b..6bac0e5 100644 --- a/internal/connectors/todoist/operation_update_project.go +++ b/internal/connectors/todoist/operation_update_project.go @@ -88,11 +88,11 @@ func (c *UpdateProjectOperation) Run(ctx *sdk.RunContext) (sdk.JSON, error) { return nil, err } - if rsp.IsError() { - return nil, errors.New(rsp.StatusText()) + if rsp.Status().IsError() { + return nil, errors.New(rsp.Status().Text()) } - bytes, err := io.ReadAll(rsp.RawBody()) + bytes, err := io.ReadAll(rsp.Raw().Body) if err != nil { return nil, err } diff --git a/internal/connectors/todoist/operation_update_task.go b/internal/connectors/todoist/operation_update_task.go index a3ca838..c1d0557 100644 --- a/internal/connectors/todoist/operation_update_task.go +++ b/internal/connectors/todoist/operation_update_task.go @@ -106,11 +106,11 @@ func (c *UpdateTaskOperation) Run(ctx *sdk.RunContext) (sdk.JSON, error) { return nil, err } - if rsp.IsError() { - return nil, errors.New(rsp.StatusText()) + if rsp.Status().IsError() { + return nil, errors.New(rsp.Status().Text()) } - bytes, err := io.ReadAll(rsp.RawBody()) + bytes, err := io.ReadAll(rsp.Raw().Body) if err != nil { return nil, err } diff --git a/internal/connectors/todoist/shared.go b/internal/connectors/todoist/shared.go index c2a26c1..9d82cc7 100644 --- a/internal/connectors/todoist/shared.go +++ b/internal/connectors/todoist/shared.go @@ -49,11 +49,11 @@ func getProjectsInput() *sdkcore.AutoFormSchema { return nil, err } - if rsp.IsError() { - return nil, errors.New(rsp.StatusText()) + if rsp.Status().IsError() { + return nil, errors.New(rsp.Status().Text()) } - bytes, err := io.ReadAll(rsp.RawBody()) + bytes, err := io.ReadAll(rsp.Raw().Body) if err != nil { return nil, err } @@ -106,11 +106,11 @@ func getSectionsInput() *sdkcore.AutoFormSchema { return nil, err } - if rsp.IsError() { - return nil, errors.New(rsp.StatusText()) + if rsp.Status().IsError() { + return nil, errors.New(rsp.Status().Text()) } - bytes, err := io.ReadAll(rsp.RawBody()) + bytes, err := io.ReadAll(rsp.Raw().Body) if err != nil { return nil, err } @@ -171,11 +171,11 @@ func getTasksInput(title string, desc string, required bool) *sdkcore.AutoFormSc return nil, err } - if rsp.IsError() { - return nil, errors.New(rsp.StatusText()) + if rsp.Status().IsError() { + return nil, errors.New(rsp.Status().Text()) } - bytes, err := io.ReadAll(rsp.RawBody()) + bytes, err := io.ReadAll(rsp.Raw().Body) if err != nil { return nil, err }