diff options
author | Yehuda Sadeh <yehuda@inktank.com> | 2013-08-28 21:24:36 -0700 |
---|---|---|
committer | Yehuda Sadeh <yehuda@inktank.com> | 2013-09-04 16:03:22 -0700 |
commit | 3c45178b45d66f575417d792c07b11212e7f0ee2 (patch) | |
tree | f3f65c2ac32419dcad6bf5ab7e555e0b6c39ad2f | |
parent | be00d1988b8ad9e275cb495b0b4eb8feb93baaa2 (diff) | |
download | ceph-3c45178b45d66f575417d792c07b11212e7f0ee2.tar.gz |
rgw: add COPY method to be handled by CORS
Was missing this http method.
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
-rw-r--r-- | src/rgw/rgw_cors.h | 12 | ||||
-rw-r--r-- | src/rgw/rgw_cors_s3.cc | 4 |
2 files changed, 11 insertions, 5 deletions
diff --git a/src/rgw/rgw_cors.h b/src/rgw/rgw_cors.h index 415f3f0b869..1e0ec3bc7ec 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 c1448f26b23..01150a9e65b 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<string>::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; } |