"Try to handle requests with abiguous multiple content length headers "
"(Content-Length, Http-Content-Length)."),
+ Option("rgw_relaxed_region_enforcement", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
+ .set_default(false)
+ .set_description("Disable region constraint enforcement")
+ .set_long_description(
+ "Enable requests such as bucket creation to succeed irrespective of region restrictions (Jewel compat)."),
+
Option("rgw_lifecycle_work_time", Option::TYPE_STR, Option::LEVEL_ADVANCED)
.set_default("00:00-06:00")
.set_description("Lifecycle allowed work time")
if (op_ret < 0)
return;
- if (!location_constraint.empty() &&
+ if (!relaxed_region_enforcement &&
+ !location_constraint.empty() &&
!store->has_zonegroup_api(location_constraint)) {
ldpp_dout(this, 0) << "location constraint (" << location_constraint << ")"
<< " can't be found." << dendl;
return;
}
- if (!store->get_zonegroup().is_master_zonegroup() && !location_constraint.empty() &&
+ if (!relaxed_region_enforcement && !store->get_zonegroup().is_master_zonegroup() && !location_constraint.empty() &&
store->get_zonegroup().api_name != location_constraint) {
ldpp_dout(this, 0) << "location constraint (" << location_constraint << ")"
<< " doesn't match zonegroup" << " (" << store->get_zonegroup().api_name << ")"
RGWBucketInfo info;
obj_version ep_objv;
bool has_cors;
+ bool relaxed_region_enforcement;
RGWCORSConfiguration cors_config;
boost::optional<std::string> swift_ver_location;
map<string, buffer::list> attrs;
virtual bool need_metadata_upload() const { return false; }
public:
- RGWCreateBucket() : has_cors(false) {}
+ RGWCreateBucket() : has_cors(false), relaxed_region_enforcement(false) {}
void emplace_attr(std::string&& key, buffer::list&& bl) {
attrs.emplace(std::move(key), std::move(bl)); /* key and bl are r-value refs */
void init(RGWRados *store, struct req_state *s, RGWHandler *h) override {
RGWOp::init(store, s, h);
policy.set_ctx(s->cct);
+ relaxed_region_enforcement =
+ s->cct->_conf->get_val<bool>("rgw_relaxed_region_enforcement");
}
virtual int get_params() { return 0; }
void send_response() override = 0;