From: ramin.najarbashi Date: Sat, 6 Jun 2026 13:16:53 +0000 (+0330) Subject: fix: some issue based on CORS spec 6.2.4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d905c1321bd439325200fe694f76e2805e89dee4;p=ceph.git fix: some issue based on CORS spec 6.2.4 Signed-off-by: ramin.najarbashi (cherry picked from commit b5624b63f2245058acee9045386bb9f81e06fae2) --- diff --git a/src/rgw/rgw_cors.cc b/src/rgw/rgw_cors.cc index 266dea476812..c1d20a6e2cf0 100644 --- a/src/rgw/rgw_cors.cc +++ b/src/rgw/rgw_cors.cc @@ -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 hdrs;