Skip to content

Commit

Permalink
Merge pull request #13303 from Jing-Scott/fix-swift-cannot-disable-ob…
Browse files Browse the repository at this point in the history
…ject-versioning

rgw: fix swift cannot disable object versioning

@Jing-Scott  updated, addressing @rzarzynski's change request
  • Loading branch information
mattbenjamin committed Feb 13, 2017
2 parents 1383652 + 17c5a0e commit 24f43e9
Showing 1 changed file with 2 additions and 3 deletions.
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

0 comments on commit 24f43e9

Please sign in to comment.