diff options
author | Casey Bodley <cbodley@users.noreply.github.com> | 2024-11-25 23:35:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-25 23:35:39 +0100 |
commit | 236002230ab5107bf48c51c75392f57844ddef39 (patch) | |
tree | e3fbdddccc2a422d0cd64b47a1468c2884c98c99 /src | |
parent | Merge pull request #60813 from anthonyeleven/improve-subsystem (diff) | |
parent | rgw:Wrong x-rgw-quota-bucket-objects header when bucket quota is disabled (diff) | |
download | ceph-236002230ab5107bf48c51c75392f57844ddef39.tar.xz ceph-236002230ab5107bf48c51c75392f57844ddef39.zip |
Merge pull request #60756 from ArbitCode/wip-raja-rgw-fix-68211
rgw:Wrong x-rgw-quota-bucket-objects header when bucket quota is disabled
Reviewed-by: Casey Bodley <cbodley@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/rgw/rgw_rest_s3.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index a245fca9945..68223405cf4 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -2399,11 +2399,17 @@ static void dump_bucket_metadata(req_state *s, rgw::sal::Bucket* bucket, if (s->auth.identity->is_owner_of(bucket->get_owner())) { const auto& user_info = s->user->get_info(); const auto& bucket_quota = s->bucket->get_info().quota; // bucket quota - dump_header(s, "X-RGW-Quota-User-Size", static_cast<long long>(user_info.quota.user_quota.max_size)); - dump_header(s, "X-RGW-Quota-User-Objects", static_cast<long long>(user_info.quota.user_quota.max_objects)); dump_header(s, "X-RGW-Quota-Max-Buckets", static_cast<long long>(user_info.max_buckets)); - dump_header(s, "X-RGW-Quota-Bucket-Size", static_cast<long long>(bucket_quota.max_size)); - dump_header(s, "X-RGW-Quota-Bucket-Objects", static_cast<long long>(bucket_quota.max_objects)); + + if (user_info.quota.user_quota.enabled){ + dump_header(s, "X-RGW-Quota-User-Size", static_cast<long long>(user_info.quota.user_quota.max_size)); + dump_header(s, "X-RGW-Quota-User-Objects", static_cast<long long>(user_info.quota.user_quota.max_objects)); + } + + if (bucket_quota.enabled){ + dump_header(s, "X-RGW-Quota-Bucket-Size", static_cast<long long>(bucket_quota.max_size)); + dump_header(s, "X-RGW-Quota-Bucket-Objects", static_cast<long long>(bucket_quota.max_objects)); + } } } |