Merge pull request from tobias-urdin/rgw-presigned-500

rgw/auth: fix internal server error for presigned urls

Reviewed-by: Casey Bodley <cbodley@redhat.com>
This commit is contained in:
Casey Bodley 2024-10-07 09:10:03 -04:00 committed by GitHub
commit 65851613ba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -505,12 +505,12 @@ rgw::auth::Strategy::apply(const DoutPrefixProvider *dpp, const rgw::auth::Strat
ldpp_dout(dpp, 5) << "Failed the auth strategy, reason="
<< result.get_reason() << dendl;
// Special handling for expired pre-signed URL
if (result.get_reason() == ERR_PRESIGNED_URL_EXPIRED) {
if (result.get_reason() == -ERR_PRESIGNED_URL_EXPIRED) {
result = result_t::deny(-EPERM);
set_req_state_err(s, -EPERM, "The pre-signed URL has expired");
}
// Special handling for disabled presigned URL
if (result.get_reason() == ERR_PRESIGNED_URL_DISABLED) {
if (result.get_reason() == -ERR_PRESIGNED_URL_DISABLED) {
result = result_t::deny(-EPERM);
set_req_state_err(s, -EPERM, "Presigned URLs are disabled by admin");
}