Merge pull request #13303 from Jing-Scott/fix-swift-cannot-disable-object-versioning

rgw: fix swift cannot disable object versioning

@Jing-Scott  updated, addressing @rzarzynski's change request
This commit is contained in:
Matt Benjamin 2017-02-13 10:58:04 -05:00 committed by GitHub
commit 24f43e9f51

View File

@ -603,8 +603,7 @@ 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. */
@ -612,7 +611,7 @@ static int get_swift_versioning_settings(
return -ERR_PRECONDITION_FAILED;
}
swift_ver_location = std::move(vloc);
swift_ver_location = s->info.env->get("HTTP_X_VERSIONS_LOCATION", "");
}
return 0;