From: Matt Benjamin Date: Tue, 31 Oct 2017 22:31:13 +0000 (-0400) Subject: RGW: S3 POST policy should not require Content-Type X-Git-Tag: v12.2.3~133^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ad0ea9fa530d641fdadcae29059660446b428588;p=ceph.git RGW: S3 POST policy should not require Content-Type In the current implementation, putting a key in the acting RGWPolicyEnv makes it required in RGWPolicyEnv::match_policy_vars. I'm not sure this is the intent, but in any case, add it to the env only if sent. Fixes: http://tracker.ceph.com/issues/20201 Signed-off-by: Matt Benjamin (cherry picked from commit af29276c32f7009a78bd8b90d8f7d19026859c74) --- diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index aa5b525d04da..ab031763ce17 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -1608,7 +1608,11 @@ int RGWPostObj_ObjStore_S3::get_params() env.add_var("key", s->object.name); part_str(parts, "Content-Type", &content_type); - env.add_var("Content-Type", content_type); + + /* AWS permits POST without Content-Type: http://tracker.ceph.com/issues/20201 */ + if (! content_type.empty()) { + env.add_var("Content-Type", content_type); + } map::iterator piter = parts.upper_bound(RGW_AMZ_META_PREFIX);