From: Robin H. Johnson Date: Fri, 20 May 2016 23:00:33 +0000 (-0700) Subject: rgw: fix manager selection when APIs customized X-Git-Tag: v11.0.0~414^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F9243%2Fhead;p=ceph.git rgw: fix manager selection when APIs customized When modifying rgw_enable_apis per RGW instance, such as for staticsites, you can end up with RESTManager instance being null in some cases, which returns a HTTP 405 MethodNotAllowed to all requests. Example configuration to trigger the bug: rgw_enable_apis = s3website Backport: jewel X-Note: Patch from Yehuda in private IRC discussion, 2016/05/20. Fixes: http://tracker.ceph.com/issues/15973 Fixes: http://tracker.ceph.com/issues/15974 Signed-off-by: Robin H. Johnson --- diff --git a/src/rgw/rgw_rest.cc b/src/rgw/rgw_rest.cc index d4da2b20214f..a6cadf79e8af 100644 --- a/src/rgw/rgw_rest.cc +++ b/src/rgw/rgw_rest.cc @@ -1550,9 +1550,6 @@ RGWRESTMgr *RGWRESTMgr::get_resource_mgr(struct req_state *s, const string& uri, { *out_uri = uri; - if (resources_by_size.empty()) - return this; - multimap::reverse_iterator iter; for (iter = resources_by_size.rbegin(); iter != resources_by_size.rend(); ++iter) {