Skip to content
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

rgw: fix disabling Swift's object versioning through empty X-Versions-Location #13303

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/rgw/rgw_rest_swift.cc
Expand Up @@ -603,16 +603,15 @@ static int get_swift_versioning_settings(
swift_ver_location = boost::in_place(std::string());
}

std::string vloc = s->info.env->get("HTTP_X_VERSIONS_LOCATION", "");
if (vloc.size()) {
if (s->info.env->exists("HTTP_X_VERSIONS_LOCATION")) {
/* If the Swift's versioning is globally disabled but someone wants to
* enable it for a given container, new version of Swift will generate
* the precondition failed error. */
if (! s->cct->_conf->rgw_swift_versioning_enabled) {
return -ERR_PRECONDITION_FAILED;
}

swift_ver_location = std::move(vloc);
swift_ver_location = s->info.env->get("HTTP_X_VERSIONS_LOCATION", "");
}

return 0;
Expand Down