Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

objectstorage: Do not parse NoContent responses #2513

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 24, 2022

Conversation

pierreprinetti
Copy link
Member

@pierreprinetti pierreprinetti commented Nov 23, 2022

Some Swift instances respond with HTTP status code 204 when asked to list containers and there are no containers, or when asked to list objects on an empty container. Before this patch, Gophercloud would error because the header content-type is absent on the response.

With this patch, objectstorage responses with HTTP status code 204 are immediately recognised as empty and their body is not read.

Potentially supersedes #2510

Some Swift instances respond with HTTP status code 204 when asked to
list containers and there are no containers, or when asked to list
objects on an empty container. Before this patch, Gophercloud would
error because the header `content-type` is absent on the response.

With this patch, objectstorage responses with HTTP status code 204 are
immediately recognised as empty and their body is not read.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.004%) to 80.08% when pulling 64ed1bc on shiftstack:fix_swift_204_content_type into 740fda7 on gophercloud:master.

Copy link
Contributor

@EmilienM EmilienM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

cc @mandre for a second pair of eyes

Copy link
Contributor

@mandre mandre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. This should solve #2509.

Does #2510 still makes sense?

@mandre mandre merged commit 4cc91e5 into gophercloud:master Nov 24, 2022
@mandre mandre deleted the fix_swift_204_content_type branch November 24, 2022 07:22
@pierreprinetti
Copy link
Member Author

pierreprinetti commented Nov 24, 2022

Does #2510 still makes sense?

Ideally, the current issue is solved with this PR. But we might need to take yours out of the hat again in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.