mirror of
https://github.com/ceph/ceph
synced 2025-01-03 09:32:43 +00:00
rgw: fix get_resource_mgr() to correctly identify resource
Fixes: #5262 The original test was not comparing the correct string, ended up with the effect of just checking the substring of the uri to match the resource. Signed-off-by: Yehuda Sadeh <yehuda@inktank.com> Reviewed-by: Greg Farnum <greg@inktank.com>
This commit is contained in:
parent
9a0a9c205b
commit
8d55b87f95
@ -1183,8 +1183,8 @@ RGWRESTMgr *RGWRESTMgr::get_resource_mgr(struct req_state *s, const string& uri)
|
||||
for (iter = resources_by_size.rbegin(); iter != resources_by_size.rend(); ++iter) {
|
||||
string& resource = iter->second;
|
||||
if (uri.compare(0, iter->first, resource) == 0 &&
|
||||
(resource.size() == iter->first ||
|
||||
resource[iter->first] == '/')) {
|
||||
(uri.size() == iter->first ||
|
||||
uri[iter->first] == '/')) {
|
||||
string suffix = uri.substr(iter->first);
|
||||
return resource_mgrs[resource]->get_resource_mgr(s, suffix);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user