]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: use s3website REST when higher priority and no host header 58339/head
authorSeena Fallah <seenafallah@gmail.com>
Fri, 28 Jun 2024 10:30:54 +0000 (12:30 +0200)
committerSeena Fallah <seenafallah@gmail.com>
Fri, 28 Jun 2024 10:30:54 +0000 (12:30 +0200)
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 <seenafallah@gmail.com>
src/rgw/rgw_rest.cc

index 3a0652e82e2caf6bdf2f608ae5f0740713ab4f17..102f05d786288f2cb52c238f624eb16c560801ef 100644 (file)
@@ -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()) {