]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: don't crash on missing /etc/mime.types 27354/head
authorCasey Bodley <cbodley@redhat.com>
Fri, 15 Mar 2019 20:47:19 +0000 (16:47 -0400)
committerPrashant D <pdhange@redhat.com>
Wed, 3 Apr 2019 03:01:29 +0000 (23:01 -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 886bb316d5ca9f68f6919bd33a776adf1019b662..10c29bbf6305a80c0a71e432d15368b4a863728d 100644 (file)
@@ -192,10 +192,8 @@ const char *rgw_find_mime_by_ext(string& ext)
 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;
 }