]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
fix: some issue based on CORS spec 6.2.4
authorramin.najarbashi <ramin.najarbashi@gmail.com>
Sat, 6 Jun 2026 13:16:53 +0000 (16:46 +0330)
committerramin.najarbashi <ramin.najarbashi@gmail.com>
Mon, 22 Jun 2026 17:02:08 +0000 (20:32 +0330)
Signed-off-by: ramin.najarbashi <ramin.najarbashi@gmail.com>
(cherry picked from commit b5624b63f2245058acee9045386bb9f81e06fae2)

src/rgw/rgw_cors.cc

index 266dea4768125dc13308b82640c8873f4e9ccb20..c1d20a6e2cf023f9aae9bf5195ec07c705eb473c 100644 (file)
@@ -245,6 +245,10 @@ bool RGWCORSRule::matches_method(const char *req_meth)
     dout(5) << "matches_method: req_meth is null or empty" << dendl;
     return false;
   }
+  if (allowed_methods == RGW_CORS_ALL) {
+    dout(10) << "matches_method: AllowedMethod * allows " << req_meth << dendl;
+    return true;
+  }
   const uint8_t flags = get_multi_cors_method_flags(req_meth);
   return flags != 0 && (allowed_methods & flags);
 }
@@ -252,6 +256,8 @@ bool RGWCORSRule::matches_method(const char *req_meth)
 bool RGWCORSRule::matches_preflight_headers(const char *req_hdrs)
 {
   if (!req_hdrs || !*req_hdrs) {
+    dout(20) << "matches_preflight_headers: no Access-Control-Request-Headers, "
+             << "passing per CORS spec 6.2.4" << dendl;
     return true;
   }
   vector<string> hdrs;