Skip to content

Commit

Permalink
Allow custom response handlers to return nil result values
Browse files Browse the repository at this point in the history
Maintain consistent behavior with the default handler by returning nil for HTTP responses with a status code of 204 or empty body.
  • Loading branch information
zhangyangjing authored May 9, 2024
1 parent 75e4bec commit 9d3829d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions nethttp_request_adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9d3829d

Please sign in to comment.