You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore(osgen): drop dead body-drain in plugin do() no-decode path
opensearch.Do routes through the buffered (*opensearchtransport.Client).Perform,
so resp.Body in the plugin do[T] helpers is already an io.NopCloser over
a bytes.Reader -- the connection has been drained and returned to the
pool. The no-decode error-path drain added in PR opensearch-project#859 was only meaningful
when DisableResponseBuffering=true, which has been removed.
Strip the drain from the cmd/osgen plugin client template and the four
hand-written copies (opensearchapi, v5preview/opensearchapi,
plugins/security, plugins/ism). The helper now reads:
if resp.IsError() {
if dataPointer != nil {
return resp, opensearch.ParseError(resp)
}
return resp, fmt.Errorf("status: %s", resp.Status())
}
with a doc comment noting resp.Body has already been buffered and closed
by Perform.
Signed-off-by: Sean Chittenden <sean.chittenden@crowdstrike.com>
0 commit comments