]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw-multisite: fix the problem of rgw website configure 'RedirectAllRequestsTo' faile... 15036/head
authoryuliyang <yuliyang@cmss.chinamobile.com>
Wed, 10 May 2017 16:26:57 +0000 (00:26 +0800)
committeryuliyang <yuliyang@cmss.chinamobile.com>
Tue, 16 May 2017 06:45:43 +0000 (14:45 +0800)
Signed-off-by: yuliyang <yuliyang@cmss.chinamobile.com>
src/rgw/rgw_json_enc.cc

index 2a183b5919583645308a2730adf0c1034ee17ea0..25b5fbdf4e3c5e7da8db3c0b6def57928df4ccc3 100644 (file)
@@ -698,12 +698,17 @@ void RGWBWRoutingRules::decode_json(JSONObj *obj) {
 
 void RGWBucketWebsiteConf::dump(Formatter *f) const
 {
-  encode_json("index_doc_suffix", index_doc_suffix, f);
-  encode_json("error_doc", error_doc, f);
-  encode_json("routing_rules", routing_rules, f);
+  if (!redirect_all.hostname.empty()) {
+    encode_json("redirect_all", redirect_all, f);
+  } else {
+    encode_json("index_doc_suffix", index_doc_suffix, f);
+    encode_json("error_doc", error_doc, f);
+    encode_json("routing_rules", routing_rules, f);
+  }
 }
 
 void RGWBucketWebsiteConf::decode_json(JSONObj *obj) {
+  JSONDecoder::decode_json("redirect_all", redirect_all, obj);
   JSONDecoder::decode_json("index_doc_suffix", index_doc_suffix, obj);
   JSONDecoder::decode_json("error_doc", error_doc, obj);
   JSONDecoder::decode_json("routing_rules", routing_rules, obj);