From 2adc133b86a50a6c79d59f81b245b6bfd5cf1e14 Mon Sep 17 00:00:00 2001 From: Matt Benjamin Date: Tue, 31 Oct 2017 18:31:13 -0400 Subject: [PATCH] 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) --- src/rgw/rgw_rest_s3.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index aa5b525d04da8..ab031763ce172 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); -- 2.39.5