Skip to content

Commit

Permalink
rgw: fix manager selection when APIs customized
Browse files Browse the repository at this point in the history
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: #15973
Fixes: #15974
Signed-off-by: Robin H. Johnson <robin.johnson@dreamhost.com>
  • Loading branch information
Robin H. Johnson committed May 20, 2016
1 parent c11db6f commit 3197b3d
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/rgw/rgw_rest.cc
Expand Up @@ -1539,9 +1539,6 @@ RGWRESTMgr *RGWRESTMgr::get_resource_mgr(struct req_state *s, const string& uri,
{
*out_uri = uri;

if (resources_by_size.empty())
return this;

multimap<size_t, string>::reverse_iterator iter;

for (iter = resources_by_size.rbegin(); iter != resources_by_size.rend(); ++iter) {
Expand Down

0 comments on commit 3197b3d

Please sign in to comment.