]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: don't crash on missing /etc/mime.types 27329/head
authorCasey Bodley <cbodley@redhat.com>
Fri, 15 Mar 2019 20:47:19 +0000 (16:47 -0400)
committerPrashant D <pdhange@redhat.com>
Tue, 2 Apr 2019 23:08:56 +0000 (19:08 -0400)
lack of mime types is not a fatal error. when a Content-Type header
is not provided in swift's PutObj, it uses this mime type mapping
to guess a content type based on the object's suffix

Fixes: http://tracker.ceph.com/issues/38328
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 89dc5a6df4503d70555bcd80af0e2f6ee896e28a)

src/rgw/rgw_tools.cc

index 5670ee1eabd530b18108a8c92223926bd28b9e0f..11645dabb397728c8eba454cb15878bb5602173a 100644 (file)
@@ -450,10 +450,8 @@ void RGWDataAccess::Object::set_policy(const RGWAccessControlPolicy& policy)
 int rgw_tools_init(CephContext *cct)
 {
   ext_mime_map = new std::map<std::string, std::string>;
-  int ret = ext_mime_map_init(cct, cct->_conf->rgw_mime_types_file.c_str());
-  if (ret < 0)
-    return ret;
-
+  ext_mime_map_init(cct, cct->_conf->rgw_mime_types_file.c_str());
+  // ignore errors; missing mime.types is not fatal
   return 0;
 }