diff --git a/CHANGELOG.md b/CHANGELOG.md index da2b6b6..e86a462 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +## [1.3.4] - 2024-05-09 + +### Changed + +- Allow custom response handlers to return nil result values. + ## [1.3.3] - 2024-03-19 - Fix bug where overriding http.DefaultTransport with an implementation other than http.Transport would result in an interface conversion panic diff --git a/nethttp_request_adapter.go b/nethttp_request_adapter.go index c140636..243483d 100644 --- a/nethttp_request_adapter.go +++ b/nethttp_request_adapter.go @@ -337,6 +337,9 @@ func (a *NetHttpRequestAdapter) Send(ctx context.Context, requestInfo *abs.Reque span.RecordError(err) return nil, err } + if result == nil { + return nil, nil + } return result.(absser.Parsable), nil } else if response != nil { defer a.purge(response) @@ -394,6 +397,9 @@ func (a *NetHttpRequestAdapter) SendEnum(ctx context.Context, requestInfo *abs.R span.RecordError(err) return nil, err } + if result == nil { + return nil, nil + } return result.(absser.Parsable), nil } else if response != nil { defer a.purge(response) @@ -445,6 +451,9 @@ func (a *NetHttpRequestAdapter) SendCollection(ctx context.Context, requestInfo span.RecordError(err) return nil, err } + if result == nil { + return nil, nil + } return result.([]absser.Parsable), nil } else if response != nil { defer a.purge(response) @@ -496,6 +505,9 @@ func (a *NetHttpRequestAdapter) SendEnumCollection(ctx context.Context, requestI span.RecordError(err) return nil, err } + if result == nil { + return nil, nil + } return result.([]any), nil } else if response != nil { defer a.purge(response) @@ -555,6 +567,9 @@ func (a *NetHttpRequestAdapter) SendPrimitive(ctx context.Context, requestInfo * span.RecordError(err) return nil, err } + if result == nil { + return nil, nil + } return result.(absser.Parsable), nil } else if response != nil { defer a.purge(response) @@ -636,6 +651,9 @@ func (a *NetHttpRequestAdapter) SendPrimitiveCollection(ctx context.Context, req span.RecordError(err) return nil, err } + if result == nil { + return nil, nil + } return result.([]any), nil } else if response != nil { defer a.purge(response) diff --git a/user_agent_handler.go b/user_agent_handler.go index c984b8e..2ebc657 100644 --- a/user_agent_handler.go +++ b/user_agent_handler.go @@ -42,7 +42,7 @@ func NewUserAgentHandlerOptions() *UserAgentHandlerOptions { return &UserAgentHandlerOptions{ Enabled: true, ProductName: "kiota-go", - ProductVersion: "1.3.3", + ProductVersion: "1.3.4", } }