Skip to content

[core]: handle empty response body#3188

Merged
EmilienM merged 1 commit intogophercloud:masterfrom
kayrus:handle-eof
Oct 4, 2024
Merged

[core]: handle empty response body#3188
EmilienM merged 1 commit intogophercloud:masterfrom
kayrus:handle-eof

Conversation

@kayrus
Copy link
Copy Markdown
Contributor

@kayrus kayrus commented Sep 26, 2024

Fixes gophercloud/utils#198

Not sure whether we need to adjust the utils itself like gophercloud/utils#230

I'm not sure whether we need to check for err != io.EOF in the doRequest's json.NewDecoder(resp.Body).Decode(options.JSONResponse). It's not clear whether API should return body or not, e.g. [] or {} or an empty response.

@kayrus kayrus requested a review from a team September 26, 2024 20:09
@github-actions github-actions bot added edit:config This PR updates config code edit:orchestration This PR updates orchestration code edit:gophercloud This PR updates common Gophercloud code edit:dependencies This PR updates dependencies edit:container This PR updates container code semver:patch No API change labels Sep 26, 2024
@github-actions github-actions bot added the edit:loadbalancer This PR updates loadbalancer code label Sep 26, 2024
@pierreprinetti pierreprinetti removed edit:config This PR updates config code edit:orchestration This PR updates orchestration code edit:loadbalancer This PR updates loadbalancer code edit:gophercloud This PR updates common Gophercloud code edit:dependencies This PR updates dependencies edit:container This PR updates container code labels Sep 26, 2024
@github-actions github-actions bot added edit:networking This PR updates networking code edit:gophercloud This PR updates common Gophercloud code labels Sep 26, 2024
@coveralls
Copy link
Copy Markdown

coveralls commented Sep 26, 2024

Coverage Status

coverage: 78.716%. remained the same
when pulling 9c94b95 on kayrus:handle-eof
into dc2e6a5 on gophercloud:master.

@EmilienM EmilienM merged commit 131740e into gophercloud:master Oct 4, 2024
@kayrus kayrus deleted the handle-eof branch October 4, 2024 07:06
@kayrus kayrus added the backport-v2 This PR will be backported to v2 label Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-v2 This PR will be backported to v2 edit:gophercloud This PR updates common Gophercloud code edit:networking This PR updates networking code semver:patch No API change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EOF Error from Gophercloud API Client Despite 202 Accepted Response

4 participants