From 583f9009c3b09363c85521164f646e3b68053663 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Fri, 15 Mar 2019 16:47:19 -0400 Subject: [PATCH] rgw: don't crash on missing /etc/mime.types 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 (cherry picked from commit 89dc5a6df4503d70555bcd80af0e2f6ee896e28a) --- src/rgw/rgw_tools.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/rgw/rgw_tools.cc b/src/rgw/rgw_tools.cc index 088fcc622e3c..5ac0b473e6e4 100644 --- a/src/rgw/rgw_tools.cc +++ b/src/rgw/rgw_tools.cc @@ -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; - 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; } -- 2.47.3