From: Yehuda Sadeh Date: Thu, 29 Aug 2013 04:24:36 +0000 (-0700) Subject: rgw: add COPY method to be handled by CORS X-Git-Tag: v0.67.4~32^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=13b28cc3f1eb8ef42875b630c485ee0105cd244a;p=ceph.git rgw: add COPY method to be handled by CORS Was missing this http method. Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_cors.h b/src/rgw/rgw_cors.h index 415f3f0b869b..1e0ec3bc7ece 100644 --- a/src/rgw/rgw_cors.h +++ b/src/rgw/rgw_cors.h @@ -25,11 +25,13 @@ #define RGW_CORS_HEAD 0x4 #define RGW_CORS_POST 0x8 #define RGW_CORS_DELETE 0x10 -#define RGW_CORS_ALL (RGW_CORS_GET | \ - RGW_CORS_PUT | \ - RGW_CORS_HEAD | \ - RGW_CORS_POST | \ - RGW_CORS_DELETE) +#define RGW_CORS_COPY 0x20 +#define RGW_CORS_ALL (RGW_CORS_GET | \ + RGW_CORS_PUT | \ + RGW_CORS_HEAD | \ + RGW_CORS_POST | \ + RGW_CORS_DELETE | \ + RGW_CORS_COPY) #define CORS_MAX_AGE_INVALID ((uint32_t)-1) diff --git a/src/rgw/rgw_cors_s3.cc b/src/rgw/rgw_cors_s3.cc index c1448f26b23e..01150a9e65b6 100644 --- a/src/rgw/rgw_cors_s3.cc +++ b/src/rgw/rgw_cors_s3.cc @@ -44,6 +44,8 @@ void RGWCORSRule_S3::to_xml(XMLFormatter& f) { f.dump_string("AllowedMethod", "HEAD"); if (allowed_methods & RGW_CORS_POST) f.dump_string("AllowedMethod", "POST"); + if (allowed_methods & RGW_CORS_COPY) + f.dump_string("AllowedMethod", "COPY"); /*AllowedOrigins*/ for(set::iterator it = allowed_origins.begin(); it != allowed_origins.end(); @@ -87,6 +89,8 @@ bool RGWCORSRule_S3::xml_end(const char *el) { allowed_methods |= RGW_CORS_HEAD; } else if (strcasecmp(s, "PUT") == 0) { allowed_methods |= RGW_CORS_PUT; + } else if (strcasecmp(s, "COPY") == 0) { + allowed_methods |= RGW_CORS_COPY; } else { return false; }