Skip to content

Commit

Permalink
x-pack/filebeat/input/entityanalytics/provider/okta/internal/okta: ha…
Browse files Browse the repository at this point in the history
…ndle empty responses gracefully
  • Loading branch information
efd6 committed Nov 13, 2023
1 parent 0f011b0 commit c69f174
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff]
- Add validation to http_endpoint config for empty URL {pull}36816[36816] {issue}36772[36772]
- Fix merging of array fields(processors, paths, parsers) in configurations generated from hints and default config. {issue}36838[36838] {pull}36857[36857]
- Fix handling of response errors in HTTPJSON and CEL request trace logging. {pull}36956[36956]
- Do not error when Okta API returns no data. {pull}[]

*Heartbeat*

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,13 @@ func getDetails[E entity](ctx context.Context, cli *http.Client, u *url.URL, key
}

var body bytes.Buffer
_, err = io.Copy(&body, resp.Body)
n, err := io.Copy(&body, resp.Body)
if err != nil {
return nil, nil, err
}
if n == 0 {
return nil, nil, nil
}

if all {
// List all entities.
Expand Down

0 comments on commit c69f174

Please sign in to comment.