summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@inktank.com>2013-06-06 21:47:21 -0700
committerGreg Farnum <greg@inktank.com>2013-06-07 13:59:59 -0700
commitbd12e81e48014024171c55f5984c9183c8e363cb (patch)
tree5b9e169aa00eea4230af24bd36af5c9aeb50d223
parentb1d436e752c9c20e7dbff91b769cb2ba47383571 (diff)
downloadceph-bd12e81e48014024171c55f5984c9183c8e363cb.tar.gz
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> (cherry picked from commit 8d55b87f95d59dbfcfd0799c4601ca37ebb025f5)
-rw-r--r--src/rgw/rgw_rest.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rgw/rgw_rest.cc b/src/rgw/rgw_rest.cc
index ba38a034c94..64f9e150b64 100644
--- a/src/rgw/rgw_rest.cc
+++ b/src/rgw/rgw_rest.cc
@@ -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);
}