From: Seena Fallah Date: Fri, 28 Jun 2024 10:30:54 +0000 (+0200) Subject: rgw: use s3website REST when higher priority and no host header X-Git-Tag: v20.0.0~1603^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F58339%2Fhead;p=ceph.git rgw: use s3website REST when higher priority and no host header If the Host header is missing, but the s3website API is enabled and has a higher priority than the regular S3 API, then we should still treat the request as a website request. Fixes: https://tracker.ceph.com/issues/66748 Signed-off-by: Seena Fallah --- diff --git a/src/rgw/rgw_rest.cc b/src/rgw/rgw_rest.cc index 3a0652e82e2c..102f05d78628 100644 --- a/src/rgw/rgw_rest.cc +++ b/src/rgw/rgw_rest.cc @@ -2164,6 +2164,11 @@ int RGWREST::preprocess(req_state *s, rgw::io::BasicClient* cio) << " s->info.domain=" << s->info.domain << " s->info.request_uri=" << s->info.request_uri << dendl; + } else if (s3website_enabled && api_priority_s3website > api_priority_s3) { + // If the Host header is missing, but the s3website API is enabled and has + // a higher priority than the regular S3 API, then we should still treat + // the request as a website request. + s->prot_flags |= RGW_REST_WEBSITE; } if (s->info.domain.empty()) {