@@ -2399,11 +2399,17 @@ static void dump_bucket_metadata(req_state *s, rgw::sal::Bucket* bucket,
23992399 if (s->auth .identity ->is_owner_of (bucket->get_owner ())) {
24002400 const auto & user_info = s->user ->get_info ();
24012401 const auto & bucket_quota = s->bucket ->get_info ().quota ; // bucket quota
2402- dump_header (s, " X-RGW-Quota-User-Size" , static_cast <long long >(user_info.quota .user_quota .max_size ));
2403- dump_header (s, " X-RGW-Quota-User-Objects" , static_cast <long long >(user_info.quota .user_quota .max_objects ));
24042402 dump_header (s, " X-RGW-Quota-Max-Buckets" , static_cast <long long >(user_info.max_buckets ));
2405- dump_header (s, " X-RGW-Quota-Bucket-Size" , static_cast <long long >(bucket_quota.max_size ));
2406- dump_header (s, " X-RGW-Quota-Bucket-Objects" , static_cast <long long >(bucket_quota.max_objects ));
2403+
2404+ if (user_info.quota .user_quota .enabled ){
2405+ dump_header (s, " X-RGW-Quota-User-Size" , static_cast <long long >(user_info.quota .user_quota .max_size ));
2406+ dump_header (s, " X-RGW-Quota-User-Objects" , static_cast <long long >(user_info.quota .user_quota .max_objects ));
2407+ }
2408+
2409+ if (bucket_quota.enabled ){
2410+ dump_header (s, " X-RGW-Quota-Bucket-Size" , static_cast <long long >(bucket_quota.max_size ));
2411+ dump_header (s, " X-RGW-Quota-Bucket-Objects" , static_cast <long long >(bucket_quota.max_objects ));
2412+ }
24072413 }
24082414}
24092415
0 commit comments